offapi/UnoApi_offapi.mk | 6 + offapi/com/sun/star/animations/AnimateColor.idl | 38 +++++++ offapi/com/sun/star/animations/AnimateMotion.idl | 38 +++++++ offapi/com/sun/star/animations/AnimateSet.idl | 38 +++++++ offapi/com/sun/star/animations/Audio.idl | 38 +++++++ offapi/com/sun/star/animations/Command.idl | 38 +++++++ offapi/com/sun/star/animations/IterateContainer.idl | 38 +++++++ sd/inc/CustomAnimationEffect.hxx | 2 sd/source/core/CustomAnimationEffect.cxx | 107 ++++++++------------ sd/source/filter/ppt/pptinanimations.cxx | 21 +-- sd/source/filter/xml/sdxmlwrp.cxx | 37 ++---- sd/source/ui/framework/module/ModuleController.cxx | 57 +++++----- sd/source/ui/slideshow/slideshowviewimpl.cxx | 3 13 files changed, 328 insertions(+), 133 deletions(-)
New commits: commit 3286827b38ce6f6aff2da123e9f246ad923932cd Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 25 14:43:24 2013 +0200 fdo#46808, Convert some XMultiServiceFactory to XComponentContext Change-Id: I1dcfee9fa0fdc4457754396ffb52cc8462f3906a diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx index da337cd..8b64065 100644 --- a/sd/inc/CustomAnimationEffect.hxx +++ b/sd/inc/CustomAnimationEffect.hxx @@ -350,8 +350,6 @@ protected: void notify_listeners(); - ::com::sun::star::uno::Reference< ::com::sun::star::animations::XTimeContainer > createParallelTimeContainer() const; - void updateTextGroups(); protected: diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 8d2a7bd..21a098f 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1886,7 +1886,7 @@ CustomAnimationEffectPtr EffectSequenceHelper::append( const SdrPathObj& rPathOb try { - Reference< XTimeContainer > xEffectContainer( createParallelTimeContainer() ); + Reference< XTimeContainer > xEffectContainer( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW ); Reference< XAnimationNode > xAnimateMotion( AnimateMotion::create( ::comphelper::getProcessComponentContext() ) ); xAnimateMotion->setDuration( Any( fDuration ) ); @@ -2013,7 +2013,7 @@ void EffectSequenceHelper::implRebuild() do { // create a par container for the next click node and all following with and after effects - Reference< XTimeContainer > xOnClickContainer( createParallelTimeContainer() ); + Reference< XTimeContainer > xOnClickContainer( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW ); Event aEvent; if( mxEventSource.is() ) @@ -2047,7 +2047,7 @@ void EffectSequenceHelper::implRebuild() do { // create a par container for the current click or after effect node and all following with effects - Reference< XTimeContainer > xWithContainer( createParallelTimeContainer() ); + Reference< XTimeContainer > xWithContainer( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW ); Reference< XAnimationNode > xWithContainerNode( xWithContainer, UNO_QUERY_THROW ); xWithContainer->setBegin( makeAny( fBegin ) ); xOnClickContainer->appendChild( xWithContainerNode ); @@ -2105,14 +2105,6 @@ void EffectSequenceHelper::implRebuild() // -------------------------------------------------------------------- -Reference< XTimeContainer > EffectSequenceHelper::createParallelTimeContainer() const -{ - const OUString aServiceName( "com.sun.star.animations.ParallelTimeContainer" ); - return Reference< XTimeContainer >( ::comphelper::getProcessServiceFactory()->createInstance(aServiceName), UNO_QUERY ); -} - -// -------------------------------------------------------------------- - stl_CustomAnimationEffect_search_node_predict::stl_CustomAnimationEffect_search_node_predict( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xSearchNode ) : mxSearchNode( xSearchNode ) { @@ -2174,7 +2166,7 @@ void stl_process_after_effect_node_func(AfterEffectNode& rNode) } else // nextClick { - Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); // insert the aftereffect in the next group Reference< XTimeContainer > xClickContainer( xContainer->getParent(), UNO_QUERY_THROW ); @@ -2199,15 +2191,11 @@ void stl_process_after_effect_node_func(AfterEffectNode& rNode) else { // this does not yet have a child container, create one - const OUString aServiceName( "com.sun.star.animations.ParallelTimeContainer" ); - xNextContainer = Reference< XTimeContainer >::query( xMsf->createInstance(aServiceName) ); + xNextContainer.set( ParallelTimeContainer::create(xContext), UNO_QUERY_THROW ); - if( xNextContainer.is() ) - { - Reference< XAnimationNode > xNode( xNextContainer, UNO_QUERY_THROW ); - xNode->setBegin( makeAny( (double)0.0 ) ); - xNextClickContainer->appendChild( xNode ); - } + Reference< XAnimationNode > xNode( xNextContainer, UNO_QUERY_THROW ); + xNode->setBegin( makeAny( (double)0.0 ) ); + xNextClickContainer->appendChild( xNode ); } DBG_ASSERT( xNextContainer.is(), "ppt::stl_process_after_effect_node_func::operator(), could not find/create container!" ); } @@ -2216,8 +2204,7 @@ void stl_process_after_effect_node_func(AfterEffectNode& rNode) // if we don't have a next container, we add one to the sequence container if( !xNextContainer.is() ) { - const OUString aServiceName( "com.sun.star.animations.ParallelTimeContainer" ); - Reference< XTimeContainer > xNewClickContainer( xMsf->createInstance(aServiceName), UNO_QUERY_THROW ); + Reference< XTimeContainer > xNewClickContainer( ParallelTimeContainer::create( xContext ), UNO_QUERY_THROW ); Reference< XAnimationNode > xNewClickNode( xNewClickContainer, UNO_QUERY_THROW ); @@ -2229,7 +2216,7 @@ void stl_process_after_effect_node_func(AfterEffectNode& rNode) Reference< XAnimationNode > xRefNode( xClickContainer, UNO_QUERY_THROW ); xSequenceContainer->insertAfter( xNewClickNode, xRefNode ); - xNextContainer = Reference< XTimeContainer >::query( xMsf->createInstance(aServiceName) ); + xNextContainer.set( ParallelTimeContainer::create( xContext ), UNO_QUERY_THROW ); DBG_ASSERT( xNextContainer.is(), "ppt::stl_process_after_effect_node_func::operator(), could not create container!" ); if( xNextContainer.is() ) commit 7709511aed6655c8f283db912513626850493eff Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 25 14:18:47 2013 +0200 fdo#46808, Convert animations::AnimateMotion to new style The service already existed, it just needed an IDL file Change-Id: I30cfa80fee436ed859d5bc00d1cb23e465c7e149 diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 12e64e8..0bc0676 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -37,6 +37,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/accessibil )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\ AnimateColor \ + AnimateMotion \ AnimateSet \ Audio \ Command \ diff --git a/offapi/com/sun/star/animations/AnimateMotion.idl b/offapi/com/sun/star/animations/AnimateMotion.idl new file mode 100644 index 0000000..1301964 --- /dev/null +++ b/offapi/com/sun/star/animations/AnimateMotion.idl @@ -0,0 +1,38 @@ +/* -*- 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_AnimateMotion_idl__ +#define __com_sun_star_animations_AnimateMotion_idl__ + +#include <com/sun/star/animations/XAnimationNode.idl> + + +module com { module sun { module star { module animations { + + +/** + @since LibreOffice 4.1 +*/ +service AnimateMotion : com::sun::star::animations::XAnimationNode; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 88f7bea..8d2a7bd 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -18,37 +18,38 @@ */ #include <tools/debug.hxx> -#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/animations/AnimationNodeType.hpp> #include <com/sun/star/animations/AnimateColor.hpp> +#include <com/sun/star/animations/AnimateMotion.hpp> #include <com/sun/star/animations/AnimateSet.hpp> #include <com/sun/star/animations/AnimationFill.hpp> +#include <com/sun/star/animations/AnimationTransformType.hpp> #include <com/sun/star/animations/Audio.hpp> #include <com/sun/star/animations/Command.hpp> +#include <com/sun/star/animations/Event.hpp> +#include <com/sun/star/animations/EventTrigger.hpp> #include <com/sun/star/animations/IterateContainer.hpp> #include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/animations/SequenceTimeContainer.hpp> +#include <com/sun/star/animations/Timing.hpp> +#include <com/sun/star/animations/XCommand.hpp> +#include <com/sun/star/animations/XIterateContainer.hpp> +#include <com/sun/star/animations/XAnimateTransform.hpp> +#include <com/sun/star/animations/XAnimateMotion.hpp> +#include <com/sun/star/animations/XAnimate.hpp> +#include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> +#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/presentation/EffectNodeType.hpp> #include <com/sun/star/presentation/EffectCommands.hpp> #include <com/sun/star/presentation/EffectPresetClass.hpp> #include <com/sun/star/presentation/ParagraphTarget.hpp> -#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/presentation/ShapeAnimationSubType.hpp> -#include <com/sun/star/animations/AnimationNodeType.hpp> -#include <com/sun/star/animations/XCommand.hpp> -#include <com/sun/star/animations/AnimationTransformType.hpp> -#include <com/sun/star/animations/XIterateContainer.hpp> -#include <com/sun/star/animations/XAnimateTransform.hpp> -#include <com/sun/star/animations/Event.hpp> -#include <com/sun/star/animations/EventTrigger.hpp> -#include <com/sun/star/animations/Timing.hpp> -#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/text/XText.hpp> -#include <com/sun/star/animations/XAnimate.hpp> -#include <com/sun/star/beans/NamedValue.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/util/XChangesNotifier.hpp> -#include <com/sun/star/animations/XAnimateMotion.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> #include <com/sun/star/lang/Locale.hpp> @@ -1886,8 +1887,7 @@ CustomAnimationEffectPtr EffectSequenceHelper::append( const SdrPathObj& rPathOb try { Reference< XTimeContainer > xEffectContainer( createParallelTimeContainer() ); - const OUString aServiceName( "com.sun.star.animations.AnimateMotion" ); - Reference< XAnimationNode > xAnimateMotion( ::comphelper::getProcessServiceFactory()->createInstance(aServiceName), UNO_QUERY_THROW ); + Reference< XAnimationNode > xAnimateMotion( AnimateMotion::create( ::comphelper::getProcessComponentContext() ) ); xAnimateMotion->setDuration( Any( fDuration ) ); xAnimateMotion->setFill( AnimationFill::HOLD ); commit c3eb3de42649a127490da40aa7774c29dc50281a Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 25 14:12:19 2013 +0200 fdo#46808, Convert animations::Command to new style The service already existed, just needed an IDL file Change-Id: I5e6449522ce77c36df1857213bd028336c3354bf diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index e1c6e9b..12e64e8 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -39,6 +39,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations AnimateColor \ AnimateSet \ Audio \ + Command \ IterateContainer \ ParallelTimeContainer \ SequenceTimeContainer \ diff --git a/offapi/com/sun/star/animations/Command.idl b/offapi/com/sun/star/animations/Command.idl new file mode 100644 index 0000000..21a30c7 --- /dev/null +++ b/offapi/com/sun/star/animations/Command.idl @@ -0,0 +1,38 @@ +/* -*- 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_Command_idl__ +#define __com_sun_star_animations_Command_idl__ + +#include <com/sun/star/animations/XCommand.idl> + + +module com { module sun { module star { module animations { + + +/** + @since LibreOffice 4.1 +*/ +service Command : com::sun::star::animations::XCommand; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 5f7a9e1..88f7bea 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/animations/AnimateSet.hpp> #include <com/sun/star/animations/AnimationFill.hpp> #include <com/sun/star/animations/Audio.hpp> +#include <com/sun/star/animations/Command.hpp> #include <com/sun/star/animations/IterateContainer.hpp> #include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/animations/SequenceTimeContainer.hpp> @@ -1651,8 +1652,8 @@ void CustomAnimationEffect::setStopAudio() if( mxAudio.is() ) removeAudio(); - Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() ); - Reference< XCommand > xCommand( xMsf->createInstance( "com.sun.star.animations.Command" ), UNO_QUERY_THROW ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + Reference< XCommand > xCommand( Command::create( xContext ) ); xCommand->setCommand( EffectCommands::STOPAUDIO ); diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index c6a02ba..dc0ccda 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -23,9 +23,8 @@ #include <com/sun/star/animations/Timing.hpp> #include <com/sun/star/animations/Event.hpp> #include <com/sun/star/animations/AnimationEndSync.hpp> +#include <com/sun/star/animations/Command.hpp> #include <com/sun/star/animations/EventTrigger.hpp> -#include <com/sun/star/presentation/EffectNodeType.hpp> -#include <com/sun/star/presentation/EffectPresetClass.hpp> #include <com/sun/star/animations/AnimationNodeType.hpp> #include <com/sun/star/animations/AnimationTransformType.hpp> #include <com/sun/star/animations/AnimationCalcMode.hpp> @@ -41,6 +40,8 @@ #include <com/sun/star/animations/XAnimateTransform.hpp> #include <com/sun/star/animations/ValuePair.hpp> #include <com/sun/star/animations/AnimationColorSpace.hpp> +#include <com/sun/star/presentation/EffectNodeType.hpp> +#include <com/sun/star/presentation/EffectPresetClass.hpp> #include <com/sun/star/presentation/ShapeAnimationSubType.hpp> #include <com/sun/star/presentation/EffectCommands.hpp> #include <com/sun/star/beans/NamedValue.hpp> @@ -1419,8 +1420,7 @@ int AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference< if( pChildAtom->hasChildAtom( DFF_msofbtAnimCommand ) ) { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - const OUString aServiceName( "com.sun.star.animations.Command" ); - Reference< XAnimationNode > xChildNode( xContext->getServiceManager()->createInstanceWithContext(aServiceName, xContext), UNO_QUERY ); + Reference< XAnimationNode > xChildNode( Command::create(xContext), UNO_QUERY_THROW ); nNodes += importAnimationNodeContainer( pChildAtom, xChildNode ); Reference< XTimeContainer > xParentContainer( xNode, UNO_QUERY ); if( xParentContainer.is() && xChildNode.is() ) commit a66fd8a99a8c783e4782c487666369c2e567bb95 Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 25 13:30:44 2013 +0200 fdo#46808, Convert animations::Audio and IterateContainer to new style The services already existed, they just needed IDL files Change-Id: I4e3389abb2cb0e41c9bab112cda2a7e896eb271d diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 29e1a78..e1c6e9b 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -38,6 +38,8 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/accessibil $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\ AnimateColor \ AnimateSet \ + Audio \ + IterateContainer \ ParallelTimeContainer \ SequenceTimeContainer \ TargetPropertiesCreator \ diff --git a/offapi/com/sun/star/animations/Audio.idl b/offapi/com/sun/star/animations/Audio.idl new file mode 100644 index 0000000..929a3dc --- /dev/null +++ b/offapi/com/sun/star/animations/Audio.idl @@ -0,0 +1,38 @@ +/* -*- 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_Audio_idl__ +#define __com_sun_star_animations_Audio_idl__ + +#include <com/sun/star/animations/XAudio.idl> + + +module com { module sun { module star { module animations { + + +/** + @since LibreOffice 4.1 +*/ +service Audio : com::sun::star::animations::XAudio; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/animations/IterateContainer.idl b/offapi/com/sun/star/animations/IterateContainer.idl new file mode 100644 index 0000000..a6310f5 --- /dev/null +++ b/offapi/com/sun/star/animations/IterateContainer.idl @@ -0,0 +1,38 @@ +/* -*- 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_IterateContainer_idl__ +#define __com_sun_star_animations_IterateContainer_idl__ + +#include <com/sun/star/animations/XTimeContainer.idl> + + +module com { module sun { module star { module animations { + + +/** + @since LibreOffice 4.1 +*/ +service IterateContainer : com::sun::star::animations::XTimeContainer; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 0bbaf01..5f7a9e1 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -22,6 +22,8 @@ #include <com/sun/star/animations/AnimateColor.hpp> #include <com/sun/star/animations/AnimateSet.hpp> #include <com/sun/star/animations/AnimationFill.hpp> +#include <com/sun/star/animations/Audio.hpp> +#include <com/sun/star/animations/IterateContainer.hpp> #include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/animations/SequenceTimeContainer.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -1032,14 +1034,14 @@ void CustomAnimationEffect::setIterateType( sal_Int16 nIterateType ) { sal_Int16 nTargetSubItem = mnTargetSubItem; + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference< XTimeContainer > xNewContainer; if(nIterateType) { - Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() ); - xNewContainer.set( xMsf->createInstance( OUString::createFromAscii("com.sun.star.animations.IterateContainer") ), UNO_QUERY_THROW ); + xNewContainer.set( IterateContainer::create( xContext ) ); } else - xNewContainer.set( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW ); + xNewContainer.set( ParallelTimeContainer::create( xContext ), UNO_QUERY_THROW ); Reference< XTimeContainer > xOldContainer( mxNode, UNO_QUERY_THROW ); Reference< XEnumerationAccess > xEnumerationAccess( mxNode, UNO_QUERY_THROW ); @@ -1553,8 +1555,8 @@ void CustomAnimationEffect::createAudio( const ::com::sun::star::uno::Any& rSour if( !mxAudio.is() ) try { - Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() ); - Reference< XAudio > xAudio( xMsf->createInstance( "com.sun.star.animations.Audio" ), UNO_QUERY_THROW ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + Reference< XAudio > xAudio( Audio::create( xContext ) ); xAudio->setSource( rSource ); xAudio->setVolume( fVolume ); setAudio( xAudio ); commit 725d23bee0a32eb19554efb5204789b6eb500b03 Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 25 13:23:37 2013 +0200 fdo#46808, Convert animations::AnimateColor and AnimateSet to new style The services already existed, just needed IDL files Change-Id: Ifc1980160b8472bc9bf96a36ca4bff2c4153a8b1 diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 4b6492d..29e1a78 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -36,6 +36,8 @@ $(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,\ + AnimateColor \ + AnimateSet \ ParallelTimeContainer \ SequenceTimeContainer \ TargetPropertiesCreator \ diff --git a/offapi/com/sun/star/animations/AnimateColor.idl b/offapi/com/sun/star/animations/AnimateColor.idl new file mode 100644 index 0000000..3e07383 --- /dev/null +++ b/offapi/com/sun/star/animations/AnimateColor.idl @@ -0,0 +1,38 @@ +/* -*- 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_AnimateColor_idl__ +#define __com_sun_star_animations_AnimateColor_idl__ + +#include <com/sun/star/animations/XAnimate.idl> + + +module com { module sun { module star { module animations { + + +/** + @since LibreOffice 4.1 +*/ +service AnimateColor : com::sun::star::animations::XAnimate; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/animations/AnimateSet.idl b/offapi/com/sun/star/animations/AnimateSet.idl new file mode 100644 index 0000000..8c1c1aa --- /dev/null +++ b/offapi/com/sun/star/animations/AnimateSet.idl @@ -0,0 +1,38 @@ +/* -*- 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_AnimateSet_idl__ +#define __com_sun_star_animations_AnimateSet_idl__ + +#include <com/sun/star/animations/XAnimate.idl> + + +module com { module sun { module star { module animations { + + +/** + @since LibreOffice 4.1 +*/ +service AnimateSet : com::sun::star::animations::XAnimate; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 9b397be..0bbaf01 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -19,6 +19,8 @@ #include <tools/debug.hxx> #include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/animations/AnimateColor.hpp> +#include <com/sun/star/animations/AnimateSet.hpp> #include <com/sun/star/animations/AnimationFill.hpp> #include <com/sun/star/animations/ParallelTimeContainer.hpp> #include <com/sun/star/animations/SequenceTimeContainer.hpp> @@ -72,18 +74,10 @@ #include "animations.hxx" using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; using namespace ::com::sun::star::presentation; using namespace ::com::sun::star::animations; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::XInterface; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::makeAny; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::container::XEnumerationAccess; using ::com::sun::star::container::XEnumeration; using ::com::sun::star::beans::NamedValue; @@ -978,12 +972,13 @@ Reference< XAnimationNode > CustomAnimationEffect::createAfterEffectNode() const { DBG_ASSERT( mbHasAfterEffect, "sd::CustomAnimationEffect::createAfterEffectNode(), this node has no after effect!" ); - Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - const char* pServiceName = maDimColor.hasValue() ? - "com.sun.star.animations.AnimateColor" : "com.sun.star.animations.AnimateSet"; - - Reference< XAnimate > xAnimate( xMsf->createInstance(OUString::createFromAscii(pServiceName) ), UNO_QUERY_THROW ); + Reference< XAnimate > xAnimate; + if( maDimColor.hasValue() ) + xAnimate = AnimateColor::create( xContext ); + else + xAnimate = AnimateSet::create( xContext ); Any aTo; OUString aAttributeName; commit 6f0b59e36437b8962769559dc4aabaaba897df00 Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 25 11:18:59 2013 +0200 fdo#46808, Convert some XMultiServiceFactory to XComponentContext Change-Id: If7cc52ffeb35efe0969876a9822106b1fd958b10 diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 8b5a2f2..c6a02ba 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -66,19 +66,12 @@ #include <algorithm> using ::std::map; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::makeAny; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::XInterface; using ::com::sun::star::beans::NamedValue; using ::com::sun::star::container::XEnumerationAccess; using ::com::sun::star::container::XEnumeration; using ::com::sun::star::lang::XMultiServiceFactory; +using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::animations; using namespace ::com::sun::star::presentation; @@ -328,8 +321,9 @@ Reference< XAnimationNode > AnimationImporter::createNode( const Atom* pAtom, co Reference< XAnimationNode > xNode; if( pServiceName ) { + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); const OUString aServiceName( OUString::createFromAscii(pServiceName) ); - Reference< XInterface > xFac( ::comphelper::getProcessServiceFactory()->createInstance(aServiceName) ); + Reference< XInterface > xFac( xContext->getServiceManager()->createInstanceWithContext(aServiceName, xContext) ); xNode.set(xFac , UNO_QUERY ); } @@ -1424,8 +1418,9 @@ int AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference< { if( pChildAtom->hasChildAtom( DFF_msofbtAnimCommand ) ) { + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); const OUString aServiceName( "com.sun.star.animations.Command" ); - Reference< XAnimationNode > xChildNode( ::comphelper::getProcessServiceFactory()->createInstance(aServiceName), UNO_QUERY ); + Reference< XAnimationNode > xChildNode( xContext->getServiceManager()->createInstanceWithContext(aServiceName, xContext), UNO_QUERY ); nNodes += importAnimationNodeContainer( pChildAtom, xChildNode ); Reference< XTimeContainer > xParentContainer( xNode, UNO_QUERY ); if( xParentContainer.is() && xChildNode.is() ) diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index e82ae25..cab013a 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -199,7 +199,7 @@ sal_Int32 ReadThroughComponent( Reference<io::XInputStream> xInputStream, Reference<XComponent> xModelComponent, const String& rStreamName, - Reference<lang::XMultiServiceFactory> & rFactory, + Reference<uno::XComponentContext> & rxContext, const sal_Char* pFilterName, Sequence<Any> rFilterArguments, const OUString& rName, @@ -208,7 +208,7 @@ sal_Int32 ReadThroughComponent( { DBG_ASSERT(xInputStream.is(), "input stream missing"); DBG_ASSERT(xModelComponent.is(), "document missing"); - DBG_ASSERT(rFactory.is(), "factory missing"); + DBG_ASSERT(rxContext.is(), "factory missing"); DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!"); RTL_LOGFILE_CONTEXT( aLog, "ReadThroughComponent" ); @@ -219,13 +219,13 @@ sal_Int32 ReadThroughComponent( aParserInput.aInputStream = xInputStream; // get parser - Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(comphelper::getComponentContext(rFactory)); + Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(rxContext); RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); // get filter OUString aFilterName(OUString::createFromAscii(pFilterName)); Reference< xml::sax::XDocumentHandler > xFilter( - rFactory->createInstanceWithArguments(aFilterName, rFilterArguments), + rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(aFilterName, rFilterArguments, rxContext), UNO_QUERY ); SAL_WARN_IF(!xFilter.is(), "sd", "Can't instantiate filter component: " << aFilterName); if( !xFilter.is() ) @@ -361,7 +361,7 @@ sal_Int32 ReadThroughComponent( Reference<XComponent> xModelComponent, const sal_Char* pStreamName, const sal_Char* pCompatibilityStreamName, - Reference<lang::XMultiServiceFactory> & rFactory, + Reference<uno::XComponentContext> & rxContext, const sal_Char* pFilterName, Sequence<Any> rFilterArguments, const OUString& rName, @@ -433,7 +433,7 @@ sal_Int32 ReadThroughComponent( // read from the stream return ReadThroughComponent( - xInputStream, xModelComponent, sStreamName, rFactory, + xInputStream, xModelComponent, sStreamName, rxContext, pFilterName, rFilterArguments, rName, bMustBeSuccessfull, bEncrypted ); } @@ -464,12 +464,8 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) sal_uInt32 nRet = 0; // Get service factory - Reference< lang::XMultiServiceFactory > xServiceFactory = - comphelper::getProcessServiceFactory(); - DBG_ASSERT( xServiceFactory.is(), - "XMLReader::Read: got no service manager" ); - if( !xServiceFactory.is() ) - return sal_False; + Reference< uno::XComponentContext > rxContext = + comphelper::getProcessComponentContext(); // ------------------------------------- @@ -660,26 +656,26 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) // read storage streams // #i103539#: always read meta.xml for generator nWarn = ReadThroughComponent( - xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory, + xStorage, xModelComp, "meta.xml", "Meta.xml", rxContext, pServices->mpMeta, aEmptyArgs, aName, sal_False ); if( meFilterMode != SDXMLMODE_Organizer ) { nWarn2 = ReadThroughComponent( - xStorage, xModelComp, "settings.xml", NULL, xServiceFactory, + xStorage, xModelComp, "settings.xml", NULL, rxContext, pServices->mpSettings, aFilterArgs, aName, sal_False ); } nRet = ReadThroughComponent( - xStorage, xModelComp, "styles.xml", NULL, xServiceFactory, + xStorage, xModelComp, "styles.xml", NULL, rxContext, pServices->mpStyles, aFilterArgs, aName, sal_True ); if( !nRet && (meFilterMode != SDXMLMODE_Organizer) ) nRet = ReadThroughComponent( - xStorage, xModelComp, "content.xml", "Content.xml", xServiceFactory, + xStorage, xModelComp, "content.xml", "Content.xml", rxContext, pServices->mpContent, aFilterArgs, aName, sal_True ); @@ -867,15 +863,8 @@ sal_Bool SdXMLFilter::Export() return sal_False; } - uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() ); uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); - if( !xServiceFactory.is() ) - { - OSL_FAIL( "got no service manager" ); - return sal_False; - } - uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext ); /** property map for export info set */ @@ -1056,7 +1045,7 @@ sal_Bool SdXMLFilter::Export() *pArgs <<= xWriter; - uno::Reference< document::XFilter > xFilter( xServiceFactory->createInstanceWithArguments( OUString::createFromAscii( pServices->mpService ), aArgs ), uno::UNO_QUERY ); + uno::Reference< document::XFilter > xFilter( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( OUString::createFromAscii( pServices->mpService ), aArgs, xContext ), uno::UNO_QUERY ); if( xFilter.is() ) { uno::Reference< document::XExporter > xExporter( xFilter, uno::UNO_QUERY ); diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx index a1825f2..25abb78 100644 --- a/sd/source/ui/framework/module/ModuleController.cxx +++ b/sd/source/ui/framework/module/ModuleController.cxx @@ -234,22 +234,20 @@ void ModuleController::ProcessStartupService (const ::std::vector<Any>& rValues) rValues[0] >>= sServiceName; // Instantiate service. - Reference<lang::XMultiServiceFactory> xGlobalFactory ( - ::comphelper::getProcessServiceFactory(), UNO_QUERY); - if (xGlobalFactory.is()) - { - // Create the startup service. - Sequence<Any> aArguments(1); - aArguments[0] <<= mxController; - // Note that when the new object will be destroyed at the end of - // this scope when it does not register itself anywhere. - // Typically it will add itself as ConfigurationChangeListener - // at the configuration controller. - xGlobalFactory->createInstanceWithArguments(sServiceName, aArguments); - - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ModuleController::created startup service " << - OUStringToOString(sServiceName, RTL_TEXTENCODING_UTF8).getStr()); - } + Reference<uno::XComponentContext> xContext = + ::comphelper::getProcessComponentContext(); + + // Create the startup service. + Sequence<Any> aArguments(1); + aArguments[0] <<= mxController; + // Note that when the new object will be destroyed at the end of + // this scope when it does not register itself anywhere. + // Typically it will add itself as ConfigurationChangeListener + // at the configuration controller. + xContext->getServiceManager()->createInstanceWithArgumentsAndContext(sServiceName, aArguments, xContext); + + SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ModuleController::created startup service " << + OUStringToOString(sServiceName, RTL_TEXTENCODING_UTF8).getStr()); } catch (Exception&) { @@ -278,20 +276,19 @@ void SAL_CALL ModuleController::requestResource (const OUString& rsResourceURL) if ( ! xFactory.is()) { // Create a new instance of the factory. - Reference<lang::XMultiServiceFactory> xGlobalFactory ( - ::comphelper::getProcessServiceFactory(), UNO_QUERY); - if (xGlobalFactory.is()) - { - // Create the factory service. - Sequence<Any> aArguments(1); - aArguments[0] <<= mxController; - xFactory = xGlobalFactory->createInstanceWithArguments( - iFactory->second, - aArguments); - - // Remember that this factory has been instanced. - (*mpLoadedFactories)[iFactory->second] = xFactory; - } + Reference<uno::XComponentContext> xContext = + ::comphelper::getProcessComponentContext(); + + // Create the factory service. + Sequence<Any> aArguments(1); + aArguments[0] <<= mxController; + xFactory = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( + iFactory->second, + aArguments, + xContext); + + // Remember that this factory has been instanced. + (*mpLoadedFactories)[iFactory->second] = xFactory; } } } diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 5a1cffb..e2678b8 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -655,9 +655,6 @@ void SlideShowView::init() mxWindow->addWindowListener( this ); mxWindow->addMouseListener( this ); - Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), - uno::UNO_QUERY_THROW ); - mxPointer = awt::Pointer::create( ::comphelper::getProcessComponentContext() ); getTransformation(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits