summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmloff/source/draw/animationimport.cxx11
-rw-r--r--xmloff/source/draw/shapeexport.cxx7
-rw-r--r--xmloff/source/transform/OOo2Oasis.cxx24
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& )
- {
- }
}
}