cid#1606940 Check of thread-shared field evades lock acquisition
[LibreOffice.git] / slideshow / source / engine / animationnodes / animationtransformnode.cxx
blobf246d9da90d87191e7a2809b0ffb83b0c4e77092
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <com/sun/star/animations/AnimationTransformType.hpp>
23 #include "animationtransformnode.hxx"
24 #include <animationfactory.hxx>
25 #include <activitiesfactory.hxx>
27 using namespace com::sun::star;
29 namespace slideshow::internal {
31 void AnimationTransformNode::dispose()
33 mxTransformNode.clear();
34 AnimationBaseNode::dispose();
37 AnimationActivitySharedPtr AnimationTransformNode::createActivity() const
39 ActivitiesFactory::CommonParameters aParms( fillCommonParameters() );
41 const sal_Int16 nTransformType( mxTransformNode->getTransformType() );
43 const AttributableShapeSharedPtr& rShape( getShape() );
45 switch( nTransformType )
47 default:
48 throw css::uno::RuntimeException(
49 u"AnimationTransformNode::createTransformActivity(): "
50 "Unknown transform type"_ustr );
52 case animations::AnimationTransformType::TRANSLATE:
53 case animations::AnimationTransformType::SCALE:
54 return ActivitiesFactory::createAnimateActivity(
55 aParms,
56 AnimationFactory::createPairPropertyAnimation(
57 rShape,
58 getContext().mpSubsettableShapeManager,
59 getSlideSize(),
60 nTransformType, 0 ),
61 getXAnimateNode() );
63 case animations::AnimationTransformType::ROTATE:
64 return ActivitiesFactory::createAnimateActivity(
65 aParms,
66 AnimationFactory::createNumberPropertyAnimation(
67 u"Rotate"_ustr,
68 rShape,
69 getContext().mpSubsettableShapeManager,
70 getSlideSize(),
71 getContext().mpBox2DWorld ),
72 getXAnimateNode() );
74 case animations::AnimationTransformType::SKEWX:
75 return ActivitiesFactory::createAnimateActivity(
76 aParms,
77 AnimationFactory::createNumberPropertyAnimation(
78 u"SkewX"_ustr,
79 rShape,
80 getContext().mpSubsettableShapeManager,
81 getSlideSize(),
82 getContext().mpBox2DWorld ),
83 getXAnimateNode() );
85 case animations::AnimationTransformType::SKEWY:
86 return ActivitiesFactory::createAnimateActivity(
87 aParms,
88 AnimationFactory::createNumberPropertyAnimation(
89 u"SkewY"_ustr,
90 rShape,
91 getContext().mpSubsettableShapeManager,
92 getSlideSize(),
93 getContext().mpBox2DWorld ),
94 getXAnimateNode() );
98 } // namespace slideshow::internal
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */