diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-14 13:58:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-15 08:25:36 +0200 |
commit | b12dab7bd204e65323079cc6809417c9b5dcb656 (patch) | |
tree | 42450779192b3cc6fb1d61864c8fcbd2f0eac19b /xmloff | |
parent | fdo#46808, Use service constructor (diff) | |
download | core-b12dab7bd204e65323079cc6809417c9b5dcb656.tar.gz core-b12dab7bd204e65323079cc6809417c9b5dcb656.zip |
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: I2e3480bf4f616231ee50a83f440d9bb0955e4ce6
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/transform/OOo2Oasis.cxx | 24 |
3 files changed, 20 insertions, 22 deletions
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 035fe7eb6366..12f587e3feae 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -644,8 +644,6 @@ AnimationNodeContext::AnimationNodeContext( } else { - Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - sal_Int16 nPresetClass = EffectPresetClass::CUSTOM; const sal_Char* pServiceName = 0; @@ -698,10 +696,13 @@ AnimationNodeContext::AnimationNodeContext( pServiceName = 0; } - if( pServiceName && xFactory.is() ) + if( pServiceName ) { - mxNode = Reference< XAnimationNode >( xFactory->createInstance( - OUString::createFromAscii(pServiceName) ), UNO_QUERY_THROW ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + + mxNode = Reference< XAnimationNode >( + xContext->getServiceManager()->createInstanceWithContext(OUString::createFromAscii(pServiceName), xContext), + UNO_QUERY_THROW ); if( nPresetClass != EffectPresetClass::CUSTOM ) { diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 33d60de33011..14ec5c8c205a 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -149,9 +149,9 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement { aEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine"; } - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - if ( !aEngine.isEmpty() && xFactory.is() ) + if ( !aEngine.isEmpty() ) { uno::Sequence< uno::Any > aArgument( 1 ); uno::Sequence< beans::PropertyValue > aPropValues( 2 ); @@ -161,7 +161,8 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement aPropValues[ 1 ].Name = OUString( "ForceGroupWithText" ); aPropValues[ 1 ].Value <<= bForceGroupWithText; aArgument[ 0 ] <<= aPropValues; - uno::Reference< uno::XInterface > xInterface( xFactory->createInstanceWithArguments( aEngine, aArgument ) ); + uno::Reference< uno::XInterface > xInterface( + xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext) ); if ( xInterface.is() ) { uno::Reference< drawing::XCustomShapeEngine > xCustomShapeEngine( diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index b4ac5caf2f9c..b219f6376f5a 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -1970,21 +1970,17 @@ void SAL_CALL OOo2OasisTransformer::Initialize( Reference< XDocumentHandler > xDocHandler; if( !m_aSubServiceName.isEmpty() ) { - Reference< XMultiServiceFactory > xFactory = - comphelper::getProcessServiceFactory(); - if( xFactory.is() ) + Reference< XComponentContext > xContext = + comphelper::getProcessComponentContext(); + try + { + // get filter component + xDocHandler = Reference< XDocumentHandler >( + xContext->getServiceManager()->createInstanceWithArgumentsAndContext(m_aSubServiceName, rArguments, xContext), + UNO_QUERY); + } + catch( Exception& ) { - try - { - // get filter component - xDocHandler = Reference< XDocumentHandler >( - xFactory->createInstanceWithArguments( m_aSubServiceName, - rArguments ), - UNO_QUERY); - } - catch( Exception& ) - { - } } } |