diff options
author | Noel Grandin <noel@peralex.com> | 2013-04-23 16:04:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-25 08:56:38 +0200 |
commit | 378c038918ca6c7adecf73f49e627c75ebd0e43a (patch) | |
tree | 35a5807008bd212488c47874f45eac4585713f84 /sd | |
parent | 3086d847d9ac8dbb228c10047fd7ecaa32a45263 (diff) |
fdo#46808 Convert animations::ParallelTimeContainer to new style
Change-Id: Iac6337828c807a132e561b5e9017a708be2e9729
Diffstat (limited to 'sd')
-rw-r--r-- | sd/CppunitTest_sd_filters_test.mk | 1 | ||||
-rw-r--r-- | sd/CppunitTest_sd_regression_test.mk | 1 | ||||
-rw-r--r-- | sd/source/core/CustomAnimationEffect.cxx | 14 | ||||
-rw-r--r-- | sd/source/core/sdpage_animations.cxx | 16 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 22 | ||||
-rw-r--r-- | sd/source/ui/unoidl/randomnode.cxx | 10 |
6 files changed, 31 insertions, 33 deletions
diff --git a/sd/CppunitTest_sd_filters_test.mk b/sd/CppunitTest_sd_filters_test.mk index 5ec613409b0f..23c9709a3c1b 100644 --- a/sd/CppunitTest_sd_filters_test.mk +++ b/sd/CppunitTest_sd_filters_test.mk @@ -71,6 +71,7 @@ $(eval $(call gb_CppunitTest_use_api,sd_filters_test,\ $(eval $(call gb_CppunitTest_use_ure,sd_filters_test)) $(eval $(call gb_CppunitTest_use_components,sd_filters_test,\ + animations/source/animcore/animcore \ basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ diff --git a/sd/CppunitTest_sd_regression_test.mk b/sd/CppunitTest_sd_regression_test.mk index 4c616efae9a6..9121af4ace13 100644 --- a/sd/CppunitTest_sd_regression_test.mk +++ b/sd/CppunitTest_sd_regression_test.mk @@ -66,6 +66,7 @@ $(eval $(call gb_CppunitTest_use_api,sd_regression_test,\ $(eval $(call gb_CppunitTest_use_ure,sd_regression_test)) $(eval $(call gb_CppunitTest_use_components,sd_regression_test,\ + animations/source/animcore/animcore \ basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index c24b3c9dbf90..9b397bea4708 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -20,6 +20,7 @@ #include <tools/debug.hxx> #include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/animations/AnimationFill.hpp> +#include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/animations/SequenceTimeContainer.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/presentation/EffectNodeType.hpp> @@ -1036,11 +1037,14 @@ void CustomAnimationEffect::setIterateType( sal_Int16 nIterateType ) { sal_Int16 nTargetSubItem = mnTargetSubItem; - Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() ); - const char * pServiceName = - nIterateType ? "com.sun.star.animations.IterateContainer" : "com.sun.star.animations.ParallelTimeContainer"; - Reference< XTimeContainer > xNewContainer( - xMsf->createInstance( OUString::createFromAscii(pServiceName) ), UNO_QUERY_THROW ); + Reference< XTimeContainer > xNewContainer; + if(nIterateType) + { + Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() ); + xNewContainer.set( xMsf->createInstance( OUString::createFromAscii("com.sun.star.animations.IterateContainer") ), UNO_QUERY_THROW ); + } + else + xNewContainer.set( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW ); Reference< XTimeContainer > xOldContainer( mxNode, UNO_QUERY_THROW ); Reference< XEnumerationAccess > xEnumerationAccess( mxNode, UNO_QUERY_THROW ); diff --git a/sd/source/core/sdpage_animations.cxx b/sd/source/core/sdpage_animations.cxx index e14bba4eafab..0c322d1d9f01 100644 --- a/sd/source/core/sdpage_animations.cxx +++ b/sd/source/core/sdpage_animations.cxx @@ -17,9 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/presentation/ParagraphTarget.hpp> +#include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/presentation/EffectNodeType.hpp> +#include <com/sun/star/presentation/ParagraphTarget.hpp> #include <comphelper/processfactory.hxx> #include <osl/mutex.hxx> #include <editeng/outliner.hxx> @@ -52,14 +53,11 @@ Reference< XAnimationNode > SdPage::getAnimationNode() throw (RuntimeException) { if( !mxAnimationNode.is() ) { - mxAnimationNode = Reference< XAnimationNode >::query(::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.animations.ParallelTimeContainer")); - if( mxAnimationNode.is() ) - { - Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 ); - aUserData[0].Name = "node-type"; - aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::TIMING_ROOT; - mxAnimationNode->setUserData( aUserData ); - } + mxAnimationNode.set( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW ); + Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 ); + aUserData[0].Name = "node-type"; + aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::TIMING_ROOT; + mxAnimationNode->setUserData( aUserData ); } return mxAnimationNode; diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 4dc8ef9b2fcf..e686b3e20e01 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/presentation/EffectPresetClass.hpp> #include <com/sun/star/animations/XAnimationNodeSupplier.hpp> +#include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/drawing/XDrawView.hpp> #include <com/sun/star/drawing/XShape.hpp> @@ -2364,18 +2365,15 @@ void CustomAnimationPane::onPreview( bool bForcePreview ) void CustomAnimationPane::preview( const Reference< XAnimationNode >& xAnimationNode ) { - Reference< XTimeContainer > xRoot(::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.animations.ParallelTimeContainer"), UNO_QUERY); - if( xRoot.is() ) - { - Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 ); - aUserData[0].Name = "node-type"; - aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::TIMING_ROOT; - xRoot->setUserData( aUserData ); - xRoot->appendChild( xAnimationNode ); - - Reference< XAnimationNode > xNode( xRoot, UNO_QUERY ); - SlideShow::StartPreview( mrBase, mxCurrentPage, xNode ); - } + Reference< XParallelTimeContainer > xRoot = ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ); + Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 ); + aUserData[0].Name = "node-type"; + aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::TIMING_ROOT; + xRoot->setUserData( aUserData ); + xRoot->appendChild( xAnimationNode ); + + Reference< XAnimationNode > xNode( xRoot, UNO_QUERY ); + SlideShow::StartPreview( mrBase, mxCurrentPage, xNode ); } diff --git a/sd/source/ui/unoidl/randomnode.cxx b/sd/source/ui/unoidl/randomnode.cxx index ee3c74b15e4d..a18fd1c22619 100644 --- a/sd/source/ui/unoidl/randomnode.cxx +++ b/sd/source/ui/unoidl/randomnode.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/animations/AnimationFill.hpp> #include <com/sun/star/animations/XAnimate.hpp> #include <com/sun/star/animations/AnimationRestart.hpp> +#include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -597,13 +598,8 @@ Reference< XEnumeration > SAL_CALL RandomAnimationNode::createEnumeration() else { // no presets? give empty node! - Reference< XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() ); - Reference< XEnumerationAccess > aEmptyEnumAccess( - xServiceFactory->createInstance( "com.sun.star.animations.ParallelTimeContainer" ), - UNO_QUERY ); - - if( aEmptyEnumAccess.is() ) - xEnum = aEmptyEnumAccess->createEnumeration(); + Reference< XParallelTimeContainer > xTimeContainer = ParallelTimeContainer::create( comphelper::getProcessComponentContext() ); + xEnum = xTimeContainer->createEnumeration(); } return xEnum; |