diff options
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/sdrpagewindow.cxx | 29 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdouno.cxx | 8 |
3 files changed, 20 insertions, 23 deletions
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 2c55ea66cfe2..f89fdfad2fae 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -78,22 +78,19 @@ using namespace ::com::sun::star; { // Printer and VirtualDevice, or rather: no OutDev uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - if( xFactory.is() ) - { - const_cast< SdrPageWindow* >( this )->mxControlContainer = uno::Reference< awt::XControlContainer >(xFactory->createInstance(rtl::OUString("com.sun.star.awt.UnoControlContainer")), uno::UNO_QUERY); - uno::Reference< awt::XControlModel > xModel(xFactory->createInstance(rtl::OUString("com.sun.star.awt.UnoControlContainerModel")), uno::UNO_QUERY); - uno::Reference< awt::XControl > xControl(mxControlContainer, uno::UNO_QUERY); - if (xControl.is()) - xControl->setModel(xModel); - - OutputDevice& rOutDev = rPaintWindow.GetOutputDevice(); - Point aPosPix = rOutDev.GetMapMode().GetOrigin(); - Size aSizePix = rOutDev.GetOutputSizePixel(); - - uno::Reference< awt::XWindow > xContComp(mxControlContainer, uno::UNO_QUERY); - if( xContComp.is() ) - xContComp->setPosSize(aPosPix.X(), aPosPix.Y(), aSizePix.Width(), aSizePix.Height(), awt::PosSize::POSSIZE); - } + const_cast< SdrPageWindow* >( this )->mxControlContainer = uno::Reference< awt::XControlContainer >(xFactory->createInstance(rtl::OUString("com.sun.star.awt.UnoControlContainer")), uno::UNO_QUERY); + uno::Reference< awt::XControlModel > xModel(xFactory->createInstance(rtl::OUString("com.sun.star.awt.UnoControlContainerModel")), uno::UNO_QUERY); + uno::Reference< awt::XControl > xControl(mxControlContainer, uno::UNO_QUERY); + if (xControl.is()) + xControl->setModel(xModel); + + OutputDevice& rOutDev = rPaintWindow.GetOutputDevice(); + Point aPosPix = rOutDev.GetMapMode().GetOrigin(); + Size aSizePix = rOutDev.GetOutputSizePixel(); + + uno::Reference< awt::XWindow > xContComp(mxControlContainer, uno::UNO_QUERY); + if( xContComp.is() ) + xContComp->setPosSize(aPosPix.X(), aPosPix.Y(), aSizePix.Width(), aSizePix.Height(), awt::PosSize::POSSIZE); } FmFormView* pViewAsFormView = dynamic_cast< FmFormView* >( &rView ); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 1bba0f7e9a57..170c4e27289f 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -415,19 +415,19 @@ Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine() const if ( !aEngine.Len() ) aEngine = String( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ); - Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference< XShape > aXShape = GetXShapeForSdrObject(const_cast<SdrObjCustomShape*>(this)); if ( aXShape.is() ) { - if ( aEngine.Len() && xFactory.is() ) + if ( aEngine.Len() ) { Sequence< Any > aArgument( 1 ); Sequence< PropertyValue > aPropValues( 1 ); aPropValues[ 0 ].Name = rtl::OUString("CustomShape"); aPropValues[ 0 ].Value <<= aXShape; aArgument[ 0 ] <<= aPropValues; - Reference< XInterface > xInterface( xFactory->createInstanceWithArguments( aEngine, aArgument ) ); + Reference< XInterface > xInterface( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aEngine, aArgument, xContext ) ); if ( xInterface.is() ) mxCustomShapeEngine = Reference< XCustomShapeEngine >( xInterface, UNO_QUERY ); } diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index daa6c07aab37..f9f2ca7b689b 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -485,11 +485,11 @@ void SdrUnoObj::CreateUnoControlModel(const String& rModelName) aUnoControlModelTypeName = rModelName; uno::Reference< awt::XControlModel > xModel; - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - if (aUnoControlModelTypeName.Len() && xFactory.is() ) + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + if (aUnoControlModelTypeName.Len() ) { - xModel = uno::Reference< awt::XControlModel >(xFactory->createInstance( - aUnoControlModelTypeName), uno::UNO_QUERY); + xModel = uno::Reference< awt::XControlModel >(xContext->getServiceManager()->createInstanceWithContext( + aUnoControlModelTypeName, xContext), uno::UNO_QUERY); if (xModel.is()) SetChanged(); |