Kaydet (Commit) 2c625e03 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Use service constructor for rendering::MtfRenderer

Change-Id: If15cd2ac23bf76aa79ee8134ee0fb97c64d747c3
üst 48ad2f61
...@@ -21,10 +21,15 @@ ...@@ -21,10 +21,15 @@
#define __com_sun_star_rendering_MtfRenderer_idl__ #define __com_sun_star_rendering_MtfRenderer_idl__
#include <com/sun/star/rendering/XMtfRenderer.idl> #include <com/sun/star/rendering/XMtfRenderer.idl>
#include <com/sun/star/rendering/XBitmapCanvas.idl>
module com { module sun { module star { module rendering { module com { module sun { module star { module rendering {
service MtfRenderer : XMtfRenderer; service MtfRenderer : XMtfRenderer
{
createWithBitmapCanvas([in] XBitmapCanvas Canvas);
};
}; }; }; }; }; }; }; };
......
...@@ -408,20 +408,14 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S ...@@ -408,20 +408,14 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1); Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1);
uno::Reference<rendering::XBitmap> xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize)); uno::Reference<rendering::XBitmap> xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize));
uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
if( xBitmap.is () ) if( xBitmap.is () )
{ {
uno::Reference< rendering::XMtfRenderer > xMtfRenderer;
uno::Sequence< uno::Any > args (1);
uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY ); uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY );
if( xBitmapCanvas.is() ) if( xBitmapCanvas.is() )
{ {
args[0] = uno::Any( xBitmapCanvas ); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
xMtfRenderer.set( xFactory->createInstanceWithArguments( OUString("com.sun.star.rendering.MtfRenderer"), uno::Reference< rendering::XMtfRenderer > xMtfRenderer = rendering::MtfRenderer::createWithBitmapCanvas( xContext, xBitmapCanvas );
args ), uno::UNO_QUERY );
if( xMtfRenderer.is() )
{
xBitmapCanvas->clear(); xBitmapCanvas->clear();
uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY ); uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY );
if( xMtfFastPropertySet.is() ) if( xMtfFastPropertySet.is() )
...@@ -459,7 +453,6 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S ...@@ -459,7 +453,6 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
} }
} }
} }
}
catch (const uno::RuntimeException& ) catch (const uno::RuntimeException& )
{ {
throw; // runtime errors are fatal throw; // runtime errors are fatal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment