summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/outdev.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-03 17:09:59 +0200
committerNoel Grandin <noel@peralex.com>2013-05-06 11:27:49 +0200
commit647f348c62d0a08fc26625aa58708fe9495d6904 (patch)
tree1ef5d2e81895300a4e8ddc4105d0ee149346fe24 /vcl/source/gdi/outdev.cxx
parent135d20caa4178c3a6d7682b547c5da6d58310f01 (diff)
fdo#46808, Use service constructor for rendering::CanvasFactory
Change-Id: If6bebe0d2dfb30c3fffd0fb284cd766e3f315b49
Diffstat (limited to 'vcl/source/gdi/outdev.cxx')
-rw-r--r--vcl/source/gdi/outdev.cxx20
1 files changed, 8 insertions, 12 deletions
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;
}