From 820576af4fd6441a752742b43d804e9837839925 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 19 Mar 2015 13:54:12 +0200 Subject: start wrapping OutputDevice in VclPtr Change-Id: If3ecbb0599b50d50ce6b3997ca7892200c332ffe --- cppcanvas/source/mtfrenderer/implrenderer.cxx | 12 ++++++------ cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'cppcanvas/source/mtfrenderer') diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index edc3a6ef887d..3f3894681ddf 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -2908,16 +2908,16 @@ namespace cppcanvas VectorOfOutDevStates aStateStack; - VirtualDevice aVDev; - aVDev.EnableOutput( false ); + ScopedVclPtr aVDev = new VirtualDevice; + aVDev->EnableOutput( false ); // Setup VDev for state tracking and mapping // ========================================= - aVDev.SetMapMode( rMtf.GetPrefMapMode() ); + aVDev->SetMapMode( rMtf.GetPrefMapMode() ); const Size aMtfSize( rMtf.GetPrefSize() ); - const Size aMtfSizePixPre( aVDev.LogicToPixel( aMtfSize, + const Size aMtfSizePixPre( aVDev->LogicToPixel( aMtfSize, rMtf.GetPrefMapMode() ) ); // #i44110# correct null-sized output - there are shapes @@ -2928,7 +2928,7 @@ namespace cppcanvas sal_Int32 nCurrActions(0); ActionFactoryParameters aParms(aStateStack, rCanvas, - aVDev, + *aVDev.get(), rParams, nCurrActions ); @@ -2942,7 +2942,7 @@ namespace cppcanvas 1.0 / aMtfSizePix.Height() ); tools::calcLogic2PixelAffineTransform( aStateStack.getState().mapModeTransform, - aVDev ); + *aVDev.get() ); ColorSharedPtr pColor( getCanvas()->createColor() ); diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx index fa91a85f1c3f..74a9505bcf08 100644 --- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx +++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx @@ -242,10 +242,10 @@ namespace cppcanvas // render our content into an appropriately sized // VirtualDevice with alpha channel - VirtualDevice aVDev( - *::Application::GetDefaultDevice(), 0, 0 ); - aVDev.SetOutputSizePixel( aBitmapSizePixel ); - aVDev.SetMapMode(); + ScopedVclPtr aVDev(new VirtualDevice( + *::Application::GetDefaultDevice(), 0, 0 )); + aVDev->SetOutputSizePixel( aBitmapSizePixel ); + aVDev->SetMapMode(); if( rSubset.mnSubsetBegin != 0 || rSubset.mnSubsetEnd != -1 ) @@ -334,7 +334,7 @@ namespace cppcanvas } } - aVDev.DrawTransparent( aMtf, + aVDev->DrawTransparent( aMtf, aEmptyPoint, aOutputSizePixel, *mpAlphaGradient ); @@ -342,7 +342,7 @@ namespace cppcanvas else { // no subsetting - render whole mtf - aVDev.DrawTransparent( *mpGroupMtf, + aVDev->DrawTransparent( *mpGroupMtf, aEmptyPoint, aOutputSizePixel, *mpAlphaGradient ); @@ -352,7 +352,7 @@ namespace cppcanvas // update buffered bitmap and transformation BitmapSharedPtr aBmp( VCLFactory::getInstance().createBitmap( mpCanvas, - aVDev.GetBitmapEx( + aVDev->GetBitmapEx( aEmptyPoint, aBitmapSizePixel ) ) ); mxBufferBitmap = aBmp->getUNOBitmap(); -- cgit From ad8a2074c6143d3ce05c0a5d93a553c13b950520 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 20 Mar 2015 18:58:34 +0000 Subject: cure a lot of unfortunate ScopedVclPtrs. Change-Id: I2149511f958ba75e81dc41b10b01eb9d19610037 --- cppcanvas/source/mtfrenderer/implrenderer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cppcanvas/source/mtfrenderer') diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 3f3894681ddf..129f53977373 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -2908,7 +2908,7 @@ namespace cppcanvas VectorOfOutDevStates aStateStack; - ScopedVclPtr aVDev = new VirtualDevice; + ScopedVclPtr aVDev( new VirtualDevice() ); aVDev->EnableOutput( false ); // Setup VDev for state tracking and mapping -- cgit From 5d133eb62187ae910772ff5dfeb8f2c3276e8481 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 31 Mar 2015 20:57:16 +0100 Subject: first half of non-scriptable, Instance constructor conversion. Change-Id: If73bb41bfa805e22609748f25971724b4778edb3 --- cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cppcanvas/source/mtfrenderer') diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx index 74a9505bcf08..51a8c32b4568 100644 --- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx +++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx @@ -242,8 +242,8 @@ namespace cppcanvas // render our content into an appropriately sized // VirtualDevice with alpha channel - ScopedVclPtr aVDev(new VirtualDevice( - *::Application::GetDefaultDevice(), 0, 0 )); + ScopedVclPtrInstance aVDev( + *::Application::GetDefaultDevice(), 0, 0 ); aVDev->SetOutputSizePixel( aBitmapSizePixel ); aVDev->SetMapMode(); -- cgit From 8a65284fe31e6c0a927cb88b75df7845cd248572 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 31 Mar 2015 23:04:14 +0100 Subject: Automated conversion of VclPtr construction to use Instance template. Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e --- cppcanvas/source/mtfrenderer/implrenderer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cppcanvas/source/mtfrenderer') diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 129f53977373..2e4ffce4c013 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -2908,7 +2908,7 @@ namespace cppcanvas VectorOfOutDevStates aStateStack; - ScopedVclPtr aVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > aVDev; aVDev->EnableOutput( false ); // Setup VDev for state tracking and mapping -- cgit