From e1b8e36a2693102664b8afe16ec321ef63e234aa Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 19 Mar 2015 14:58:31 +0000 Subject: Fix OutputDevice members / stack allocation: desktop, sfx2, lwp. Change-Id: I5563cfa35142f088533ae998d087dec669a13287 --- desktop/source/lib/init.cxx | 10 +++++----- desktop/source/splash/splash.cxx | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 186f60bf29f3..b7587d178209 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -606,21 +606,21 @@ void doc_paintTile (LibreOfficeKitDocument* pThis, #ifndef IOS InitSvpForLibreOfficeKit(); - VirtualDevice aDevice(0, Size(1, 1), (sal_uInt16)32); + ScopedVclPtr pDevice( new VirtualDevice(0, Size(1, 1), (sal_uInt16)32)) ; boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() ); - aDevice.SetOutputSizePixelScaleOffsetAndBuffer( + pDevice->SetOutputSizePixelScaleOffsetAndBuffer( Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aBuffer, true ); - pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight, + pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight); #else SystemGraphicsData aData; aData.rCGContext = reinterpret_cast(pBuffer); // the Size argument is irrelevant, I hope - VirtualDevice aDevice(&aData, Size(1, 1), (sal_uInt16)0); + ScopedVclPtrInstance pDevice(&aData, Size(1, 1), (sal_uInt16)0); - pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight, + pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight); #endif diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index fd55c1d77e17..cb1ed36fe063 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -150,7 +150,7 @@ SplashScreen::SplashScreen() , _yoffset(18) { loadConfig(); - _vdev.EnableRTL(IsRTLEnabled()); + _vdev->EnableRTL(IsRTLEnabled()); } SplashScreen::~SplashScreen() @@ -258,7 +258,7 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta SetScreenBitmap (_aIntroBmp); Size aSize = _aIntroBmp.GetSizePixel(); SetOutputSizePixel( aSize ); - _vdev.SetOutputSizePixel( aSize ); + _vdev->SetOutputSizePixel( aSize ); _height = aSize.Height(); _width = aSize.Width(); if (_width > 500) @@ -615,7 +615,7 @@ void SplashScreen::Paint( const Rectangle&) //non native drawing // draw bitmap if (_bPaintBitmap) - _vdev.DrawBitmapEx( Point(), _aIntroBmp ); + _vdev->DrawBitmapEx( Point(), _aIntroBmp ); if (_bPaintProgress) { // draw progress... @@ -623,20 +623,20 @@ void SplashScreen::Paint( const Rectangle&) if (length < 0) length = 0; // border - _vdev.SetFillColor(); - _vdev.SetLineColor( _cProgressFrameColor ); - _vdev.DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight)); - _vdev.SetFillColor( _cProgressBarColor ); - _vdev.SetLineColor(); - _vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace)); + _vdev->SetFillColor(); + _vdev->SetLineColor( _cProgressFrameColor ); + _vdev->DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight)); + _vdev->SetFillColor( _cProgressBarColor ); + _vdev->SetLineColor(); + _vdev->DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace)); vcl::Font aFont; aFont.SetSize(Size(0, 12)); aFont.SetAlign(ALIGN_BASELINE); - _vdev.SetFont(aFont); - _vdev.SetTextColor(_cProgressTextColor); - _vdev.DrawText(Point(_tlx, _textBaseline), _sProgressText); + _vdev->SetFont(aFont); + _vdev->SetTextColor(_cProgressTextColor); + _vdev->DrawText(Point(_tlx, _textBaseline), _sProgressText); } - DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev.GetOutputSizePixel(), _vdev ); + DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev->GetOutputSizePixel(), *_vdev.get() ); } -- cgit