From 647f348c62d0a08fc26625aa58708fe9495d6904 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 3 May 2013 17:09:59 +0200 Subject: fdo#46808, Use service constructor for rendering::CanvasFactory Change-Id: If6bebe0d2dfb30c3fffd0fb284cd766e3f315b49 --- vcl/source/gdi/outdev.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'vcl/source/gdi/outdev.cxx') 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 #include #include +#include #include #include @@ -2565,22 +2566,17 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const aArg[ 3 ] = uno::makeAny( sal_False ); aArg[ 5 ] = GetSystemGfxDataAny(); - uno::Reference xFactory = comphelper::getProcessServiceFactory(); - - uno::Reference xCanvas; + uno::Reference xContext = comphelper::getProcessComponentContext(); // Create canvas instance with window handle // ========================================= - static uno::Reference xCanvasFactory( - xFactory->createInstance( "com.sun.star.rendering.CanvasFactory" ), + static uno::Reference xCanvasFactory( rendering::CanvasFactory::create( xContext ) ); + + uno::Reference 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; } -- cgit