summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-23 16:04:30 +0200
committerNoel Grandin <noel@peralex.com>2013-04-25 08:56:38 +0200
commit378c038918ca6c7adecf73f49e627c75ebd0e43a (patch)
tree35a5807008bd212488c47874f45eac4585713f84
parent3086d847d9ac8dbb228c10047fd7ecaa32a45263 (diff)
fdo#46808 Convert animations::ParallelTimeContainer to new style
Change-Id: Iac6337828c807a132e561b5e9017a708be2e9729
-rw-r--r--animations/source/animcore/animcore.cxx18
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--offapi/com/sun/star/animations/ParallelTimeContainer.idl37
-rw-r--r--offapi/com/sun/star/animations/XParallelTimeContainer.idl42
-rw-r--r--sd/CppunitTest_sd_filters_test.mk1
-rw-r--r--sd/CppunitTest_sd_regression_test.mk1
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx14
-rw-r--r--sd/source/core/sdpage_animations.cxx16
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx22
-rw-r--r--sd/source/ui/unoidl/randomnode.cxx10
10 files changed, 125 insertions, 38 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index a503097f07d5..5b83bc0f43a9 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/animations/XAnimateSet.hpp>
#include <com/sun/star/animations/XAnimateMotion.hpp>
#include <com/sun/star/animations/XAnimateTransform.hpp>
+#include <com/sun/star/animations/XParallelTimeContainer.hpp>
#include <com/sun/star/animations/XTransitionFilter.hpp>
#include <com/sun/star/animations/XTimeContainer.hpp>
#include <com/sun/star/animations/XIterateContainer.hpp>
@@ -108,8 +109,8 @@ class AnimationNodeBase : public XAnimateMotion,
public XTransitionFilter,
public XAnimateSet,
public XAnimateTransform,
+ public XParallelTimeContainer,
public XIterateContainer,
- public XEnumerationAccess,
public XServiceInfo,
public XTypeProvider,
public XAudio,
@@ -547,9 +548,9 @@ Any SAL_CALL AnimationNode::queryInterface( const Type& aType ) throw (RuntimeEx
aType,
static_cast< XServiceInfo * >( this ),
static_cast< XTypeProvider * >( this ),
- static_cast< XChild * >( static_cast< XTimeContainer * >(this) ),
+ static_cast< XChild * >( static_cast< XTimeContainer * >( static_cast< XIterateContainer * >(this) ) ),
static_cast< XCloneable* >( this ),
- static_cast< XAnimationNode* >( static_cast< XTimeContainer * >(this) ),
+ static_cast< XAnimationNode* >( static_cast< XTimeContainer * >( static_cast< XIterateContainer * >(this) ) ),
static_cast< XInterface* >(static_cast< OWeakObject * >(this)),
static_cast< XWeak* >(static_cast< OWeakObject * >(this)),
static_cast< XChangesNotifier* >( this ),
@@ -560,17 +561,24 @@ Any SAL_CALL AnimationNode::queryInterface( const Type& aType ) throw (RuntimeEx
switch( mnNodeType )
{
case AnimationNodeType::PAR:
+ aRet = ::cppu::queryInterface(
+ aType,
+ static_cast< XParallelTimeContainer * >( this ),
+ static_cast< XTimeContainer * >( static_cast< XIterateContainer * >(this) ),
+ static_cast< XEnumerationAccess * >( this ),
+ static_cast< XElementAccess * >( this ) );
+ break;
case AnimationNodeType::SEQ:
aRet = ::cppu::queryInterface(
aType,
- static_cast< XTimeContainer * >( this ),
+ static_cast< XTimeContainer * >( static_cast< XIterateContainer * >(this) ),
static_cast< XEnumerationAccess * >( this ),
static_cast< XElementAccess * >( this ) );
break;
case AnimationNodeType::ITERATE:
aRet = ::cppu::queryInterface(
aType,
- static_cast< XTimeContainer * >( this ),
+ static_cast< XTimeContainer * >( static_cast< XIterateContainer * >(this) ),
static_cast< XIterateContainer * >( this ),
static_cast< XEnumerationAccess * >( this ),
static_cast< XElementAccess * >( this ) );
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 2099eba7776b..ed72206f6da9 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/accessibil
AccessBridge \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\
+ ParallelTimeContainer \
SequenceTimeContainer \
TargetPropertiesCreator \
))
@@ -1647,6 +1648,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/animations,\
XAudio \
XCommand \
XIterateContainer \
+ XParallelTimeContainer \
XTargetPropertiesCreator \
XTimeContainer \
XTransitionFilter \
diff --git a/offapi/com/sun/star/animations/ParallelTimeContainer.idl b/offapi/com/sun/star/animations/ParallelTimeContainer.idl
new file mode 100644
index 000000000000..a74b77cd9466
--- /dev/null
+++ b/offapi/com/sun/star/animations/ParallelTimeContainer.idl
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_animations_ParallelTimeContainer_idl__
+#define __com_sun_star_animations_ParallelTimeContainer_idl__
+
+#include <com/sun/star/animations/XParallelTimeContainer.idl>
+
+module com { module sun { module star { module animations {
+
+
+/**
+ @since LibreOffice 4.1
+*/
+service ParallelTimeContainer : com::sun::star::animations::XParallelTimeContainer;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/animations/XParallelTimeContainer.idl b/offapi/com/sun/star/animations/XParallelTimeContainer.idl
new file mode 100644
index 000000000000..42c38645ecc3
--- /dev/null
+++ b/offapi/com/sun/star/animations/XParallelTimeContainer.idl
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_animations_XParallelTimeContainer_idl__
+#define __com_sun_star_animations_XParallelTimeContainer_idl__
+
+#include <com/sun/star/animations/XTimeContainer.idl>
+#include <com/sun/star/container/XEnumerationAccess.idl>
+
+module com { module sun { module star { module animations {
+
+
+/**
+ @since LibreOffice 4.1
+*/
+interface XParallelTimeContainer
+{
+ interface com::sun::star::animations::XTimeContainer;
+ interface com::sun::star::container::XEnumerationAccess;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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;