diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-03 17:09:59 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-06 11:27:49 +0200 |
commit | 647f348c62d0a08fc26625aa58708fe9495d6904 (patch) | |
tree | 1ef5d2e81895300a4e8ddc4105d0ee149346fe24 | |
parent | 135d20caa4178c3a6d7682b547c5da6d58310f01 (diff) |
fdo#46808, Use service constructor for rendering::CanvasFactory
Change-Id: If6bebe0d2dfb30c3fffd0fb284cd766e3f315b49
-rw-r--r-- | sw/CppunitTest_sw_ooxmlexport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_rtfimport.mk | 1 | ||||
-rw-r--r-- | vcl/source/gdi/outdev.cxx | 20 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 36 |
4 files changed, 28 insertions, 30 deletions
diff --git a/sw/CppunitTest_sw_ooxmlexport.mk b/sw/CppunitTest_sw_ooxmlexport.mk index 524e70a8b4d1..e96961fade5b 100644 --- a/sw/CppunitTest_sw_ooxmlexport.mk +++ b/sw/CppunitTest_sw_ooxmlexport.mk @@ -50,6 +50,7 @@ $(eval $(call gb_CppunitTest_use_ure,sw_ooxmlexport)) $(eval $(call gb_CppunitTest_use_components,sw_ooxmlexport,\ basic/util/sb \ + canvas/source/factory/canvasfactory \ comphelper/util/comphelp \ configmgr/source/configmgr \ embeddedobj/util/embobj \ diff --git a/sw/CppunitTest_sw_rtfimport.mk b/sw/CppunitTest_sw_rtfimport.mk index e5b4f3079266..8cedeeb1e082 100644 --- a/sw/CppunitTest_sw_rtfimport.mk +++ b/sw/CppunitTest_sw_rtfimport.mk @@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_use_ure,sw_rtfimport)) $(eval $(call gb_CppunitTest_use_components,sw_rtfimport,\ basic/util/sb \ + canvas/source/factory/canvasfactory \ comphelper/util/comphelp \ configmgr/source/configmgr \ embeddedobj/util/embobj \ diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index f134388fbacb..7c03af02aed3 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -56,6 +56,7 @@ #include <com/sun/star/awt/XGraphics.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/rendering/XCanvas.hpp> +#include <com/sun/star/rendering/CanvasFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> @@ -2565,22 +2566,17 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const aArg[ 3 ] = uno::makeAny( sal_False ); aArg[ 5 ] = GetSystemGfxDataAny(); - uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory(); - - uno::Reference<rendering::XCanvas> xCanvas; + uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); // Create canvas instance with window handle // ========================================= - static uno::Reference<lang::XMultiServiceFactory> xCanvasFactory( - xFactory->createInstance( "com.sun.star.rendering.CanvasFactory" ), + static uno::Reference<lang::XMultiComponentFactory> xCanvasFactory( rendering::CanvasFactory::create( xContext ) ); + + uno::Reference<rendering::XCanvas> xCanvas; + xCanvas.set( + xCanvasFactory->createInstanceWithArgumentsAndContext( + "com.sun.star.rendering.Canvas", aArg, xContext ), uno::UNO_QUERY ); - if(xCanvasFactory.is()) - { - xCanvas.set( - xCanvasFactory->createInstanceWithArguments( - "com.sun.star.rendering.Canvas", aArg ), - uno::UNO_QUERY ); - } return xCanvas; } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 4201c39fa260..b32078a558ef 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -75,23 +75,24 @@ #include "dndlcon.hxx" #include "dndevdis.hxx" +#include "com/sun/star/accessibility/XAccessible.hpp" +#include "com/sun/star/accessibility/AccessibleRole.hpp" #include "com/sun/star/awt/XWindowPeer.hpp" -#include "com/sun/star/rendering/XCanvas.hpp" -#include "com/sun/star/rendering/XSpriteCanvas.hpp" +#include "com/sun/star/awt/XTopWindow.hpp" #include "com/sun/star/awt/XWindow.hpp" -#include "comphelper/processfactory.hxx" +#include "com/sun/star/awt/XDisplayConnection.hpp" #include "com/sun/star/datatransfer/dnd/XDragSource.hpp" #include "com/sun/star/datatransfer/dnd/XDropTarget.hpp" #include "com/sun/star/datatransfer/clipboard/XClipboard.hpp" #include "com/sun/star/datatransfer/clipboard/SystemClipboard.hpp" #include "com/sun/star/datatransfer/clipboard/SystemClipboardExt.hpp" -#include "com/sun/star/awt/XTopWindow.hpp" -#include "com/sun/star/awt/XDisplayConnection.hpp" #include "com/sun/star/lang/XInitialization.hpp" #include "com/sun/star/lang/XComponent.hpp" #include "com/sun/star/lang/XServiceName.hpp" -#include "com/sun/star/accessibility/XAccessible.hpp" -#include "com/sun/star/accessibility/AccessibleRole.hpp" +#include "com/sun/star/rendering/CanvasFactory.hpp" +#include "com/sun/star/rendering/XCanvas.hpp" +#include "com/sun/star/rendering/XSpriteCanvas.hpp" +#include "comphelper/processfactory.hxx" #include <sal/macros.h> #include <rtl/strbuf.hxx> @@ -9467,16 +9468,13 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr const_cast<Window*>(this)->GetComponentInterface(), uno::UNO_QUERY )); - uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); // Create canvas instance with window handle // ========================================= - static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory( - uno::Reference<lang::XMultiServiceFactory>( - xFactory->createInstance( - OUString( "com.sun.star.rendering.CanvasFactory" ) ), - UNO_QUERY )); - uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get()); + static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiComponentFactory> xStaticCanvasFactory( + rendering::CanvasFactory::create( xContext ) ); + uno::Reference<lang::XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.get()); if(xCanvasFactory.is()) { @@ -9489,22 +9487,24 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay; if( (nDisplay >= Application::GetScreenCount()) ) { - xCanvas.set( xCanvasFactory->createInstanceWithArguments( + xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext( bSpriteCanvas ? OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) : OUString( "com.sun.star.rendering.Canvas.MultiScreen" ), - aArg ), + aArg, + xContext ), UNO_QUERY ); } else { #endif - xCanvas.set( xCanvasFactory->createInstanceWithArguments( + xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext( bSpriteCanvas ? OUString( "com.sun.star.rendering.SpriteCanvas" ) : OUString( "com.sun.star.rendering.Canvas" ), - aArg ), + aArg, + xContext ), UNO_QUERY ); #ifdef WNT |