cui/source/tabpages/tpline.cxx | 6 +++--- desktop/source/lib/init.cxx | 8 ++++---- desktop/source/splash/splash.cxx | 26 +++++++++++++------------- lotuswordpro/source/filter/lwppagelayout.cxx | 8 ++++---- sfx2/source/dialog/backingwindow.cxx | 10 +++++----- sfx2/source/doc/objcont.cxx | 12 ++++++------ 6 files changed, 35 insertions(+), 35 deletions(-)
New commits: commit 14c931f8354f5ca6e127fa49b06264002ede1491 Author: Michael Meeks <michael.me...@collabora.com> Date: Thu Mar 19 14:58:31 2015 +0000 Fix OutputDevice members / stack allocation: desktop, sfx2, lwp. Change-Id: I5563cfa35142f088533ae998d087dec669a13287 diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 9fbaa2e..f64eddb 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -360,8 +360,8 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton) if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList) { - VirtualDevice aVDev; - aVDev.SetMapMode(MapMode(MAP_100TH_MM)); + ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + pVDev->SetMapMode(MapMode(MAP_100TH_MM)); boost::scoped_ptr<SdrModel> pModel(new SdrModel); pModel->GetItemPool().FreezeIdRanges(); // Page @@ -370,7 +370,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton) pModel->InsertPage( pPage, 0 ); { // 3D View - boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), &aVDev )); + boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev )); pView->hideMarkHandles(); pView->ShowSdrPage(pPage); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b3593d0..9d1ae9d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -566,16 +566,16 @@ void doc_paintTile (LibreOfficeKitDocument* pThis, SvpSalInstance* pSalInstance = static_cast< SvpSalInstance* >(pSVData->mpDefInst); pSalInstance->setBitCountFormatMapping( 32, ::basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA ); - VirtualDevice aDevice(0, Size(1, 1), (sal_uInt16)32); + ScopedVclPtr<VirtualDevice> 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); - SvpSalVirtualDevice* pSalDev = static_cast< SvpSalVirtualDevice* >(aDevice.getSalVirtualDevice()); + SvpSalVirtualDevice* pSalDev = static_cast< SvpSalVirtualDevice* >(pDevice->getSalVirtualDevice()); basebmp::BitmapDeviceSharedPtr pBmpDev = pSalDev->getBitmapDevice(); *pRowStride = pBmpDev->getScanlineStride(); diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index e3be3e0..1fdc406 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -149,7 +149,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() ); } diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 1a3967c..623fe0c 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -640,12 +640,12 @@ void LwpPageLayout::GetWidthAndHeight(double& fWidth, double& fHeight) if(GetUsePrinterSettings()) { //replaced by printer paper size - Printer aPrinter; - bool bScreen = aPrinter.IsDisplayPrinter(); + ScopedVclPtr<Printer> pPrinter( new Printer() ); + bool bScreen = pPrinter->IsDisplayPrinter(); if (!bScreen)//Printer available { - Size aPaperSize = aPrinter.GetPaperSize(); - aPaperSize = aPrinter.PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) ); + Size aPaperSize = pPrinter->GetPaperSize(); + aPaperSize = pPrinter->PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) ); fWidth = static_cast<double>(aPaperSize.Width())/100; //cm unit fHeight = static_cast<double>(aPaperSize.Height())/100; } diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index b603e6c..c92857c 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -393,15 +393,15 @@ void BackingWindow::Paint( const Rectangle& ) DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack ); Pop(); - VirtualDevice aDev( *this ); - aDev.EnableRTL( IsRTLEnabled() ); - aDev.SetOutputSizePixel( maStartCentButtons.GetSize() ); + ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) ); + pVDev->EnableRTL( IsRTLEnabled() ); + pVDev->SetOutputSizePixel( maStartCentButtons.GetSize() ); Point aOffset( Point( 0, 0 ) - maStartCentButtons.TopLeft()); - aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack ); + pVDev->DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack ); DrawOutDev( maStartCentButtons.TopLeft(), maStartCentButtons.GetSize(), Point( 0, 0 ), maStartCentButtons.GetSize(), - aDev ); + *pVDev.get() ); } bool BackingWindow::PreNotify( NotifyEvent& rNEvt ) diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index b47def4..ff9f9ee 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -127,11 +127,11 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const ::boost::shared_ptr<GDIMetaFile> pFile(new GDIMetaFile); - VirtualDevice aDevice; - aDevice.EnableOutput( false ); + ScopedVclPtr<VirtualDevice> pDevice( new VirtualDevice() ); + pDevice->EnableOutput( false ); MapMode aMode( ((SfxObjectShell*)this)->GetMapUnit() ); - aDevice.SetMapMode( aMode ); + pDevice->SetMapMode( aMode ); pFile->SetPrefMapMode( aMode ); Size aTmpSize; @@ -151,7 +151,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(), "size of first page is 0, overload GetFirstPageSize or set vis-area!" ); - pFile->Record( &aDevice ); + pFile->Record( pDevice ); LanguageType eLang; SvtCTLOptions aCTLOptions; @@ -162,11 +162,11 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const else eLang = (LanguageType) Application::GetSettings().GetLanguageTag().getLanguageType(); - aDevice.SetDigitLanguage( eLang ); + pDevice->SetDigitLanguage( eLang ); { SAL_INFO( "sfx.doc", "PERFORMANCE SfxObjectShell::CreatePreviewMetaFile_Impl" ); - ((SfxObjectShell*)this)->DoDraw( &aDevice, Point(0,0), aTmpSize, JobSetup(), nAspect ); + ((SfxObjectShell*)this)->DoDraw( pDevice, Point(0,0), aTmpSize, JobSetup(), nAspect ); } pFile->Stop(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits