diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-03 17:15:43 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-06 11:27:50 +0200 |
commit | 6e0d0934d0cbb74bb5a4fbf05b4448832f6d4722 (patch) | |
tree | e51b2d559f76ac7dca0209c6f1d7a9bfd660807a | |
parent | 647f348c62d0a08fc26625aa58708fe9495d6904 (diff) |
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: I65a4399de203e02b8fc90c7d2e4c783d5c156de5
-rw-r--r-- | vcl/source/window/window.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b32078a558ef..6822698da334 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -8332,7 +8332,7 @@ uno::Reference< XDragSource > Window::GetDragSource() { try { - uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); const SystemEnvData * pEnvData = GetSystemData(); if( pEnvData ) @@ -8364,10 +8364,14 @@ uno::Reference< XDragSource > Window::GetDragSource() aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() ); #endif if( !aDragSourceSN.isEmpty() ) - mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxDragSource.set( + xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aDragSourceSN, aDragSourceAL, xContext ), + UNO_QUERY ); if( !aDropTargetSN.isEmpty() ) - mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxDropTarget.set( + xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aDropTargetSN, aDropTargetAL, xContext ), + UNO_QUERY ); } } @@ -8417,7 +8421,7 @@ uno::Reference< XClipboard > Window::GetClipboard() #else xSystemClipboard = SystemClipboard::createDefault(xContext); #endif - mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xSystemClipboard, UNO_QUERY ); + mpWindowImpl->mpFrameData->mxClipboard.set( xSystemClipboard, UNO_QUERY ); } } // createInstance can throw any exception @@ -8446,7 +8450,6 @@ uno::Reference< XClipboard > Window::GetPrimarySelection() { try { - uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() ); uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); #if defined(UNX) && !defined(MACOSX) @@ -8456,10 +8459,10 @@ uno::Reference< XClipboard > Window::GetPrimarySelection() static uno::Reference< XClipboard > s_xSelection; if ( !s_xSelection.is() ) - s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboardExt") ), UNO_QUERY ); + s_xSelection.set( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboardExt", xContext ), UNO_QUERY ); if ( !s_xSelection.is() ) - s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboard") ), UNO_QUERY ); + s_xSelection.set( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboard", xContext ), UNO_QUERY ); mpWindowImpl->mpFrameData->mxSelection = s_xSelection; # endif |