Kaydet (Commit) e1b8e36a authored tarafından Michael Meeks's avatar Michael Meeks

Fix OutputDevice members / stack allocation: desktop, sfx2, lwp.

Change-Id: I5563cfa35142f088533ae998d087dec669a13287
üst eac22a06
...@@ -360,8 +360,8 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton) ...@@ -360,8 +360,8 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList) if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList)
{ {
VirtualDevice aVDev; ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
aVDev.SetMapMode(MapMode(MAP_100TH_MM)); pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel); boost::scoped_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges(); pModel->GetItemPool().FreezeIdRanges();
// Page // Page
...@@ -370,7 +370,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton) ...@@ -370,7 +370,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
pModel->InsertPage( pPage, 0 ); pModel->InsertPage( pPage, 0 );
{ {
// 3D View // 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->hideMarkHandles();
pView->ShowSdrPage(pPage); pView->ShowSdrPage(pPage);
......
...@@ -606,21 +606,21 @@ void doc_paintTile (LibreOfficeKitDocument* pThis, ...@@ -606,21 +606,21 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
#ifndef IOS #ifndef IOS
InitSvpForLibreOfficeKit(); InitSvpForLibreOfficeKit();
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 >() ); boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
aDevice.SetOutputSizePixelScaleOffsetAndBuffer( pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
aBuffer, true ); aBuffer, true );
pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight, pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight); nTilePosX, nTilePosY, nTileWidth, nTileHeight);
#else #else
SystemGraphicsData aData; SystemGraphicsData aData;
aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer); aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
// the Size argument is irrelevant, I hope // the Size argument is irrelevant, I hope
VirtualDevice aDevice(&aData, Size(1, 1), (sal_uInt16)0); ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), (sal_uInt16)0);
pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight, pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight); nTilePosX, nTilePosY, nTileWidth, nTileHeight);
#endif #endif
......
...@@ -150,7 +150,7 @@ SplashScreen::SplashScreen() ...@@ -150,7 +150,7 @@ SplashScreen::SplashScreen()
, _yoffset(18) , _yoffset(18)
{ {
loadConfig(); loadConfig();
_vdev.EnableRTL(IsRTLEnabled()); _vdev->EnableRTL(IsRTLEnabled());
} }
SplashScreen::~SplashScreen() SplashScreen::~SplashScreen()
...@@ -258,7 +258,7 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta ...@@ -258,7 +258,7 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta
SetScreenBitmap (_aIntroBmp); SetScreenBitmap (_aIntroBmp);
Size aSize = _aIntroBmp.GetSizePixel(); Size aSize = _aIntroBmp.GetSizePixel();
SetOutputSizePixel( aSize ); SetOutputSizePixel( aSize );
_vdev.SetOutputSizePixel( aSize ); _vdev->SetOutputSizePixel( aSize );
_height = aSize.Height(); _height = aSize.Height();
_width = aSize.Width(); _width = aSize.Width();
if (_width > 500) if (_width > 500)
...@@ -615,7 +615,7 @@ void SplashScreen::Paint( const Rectangle&) ...@@ -615,7 +615,7 @@ void SplashScreen::Paint( const Rectangle&)
//non native drawing //non native drawing
// draw bitmap // draw bitmap
if (_bPaintBitmap) if (_bPaintBitmap)
_vdev.DrawBitmapEx( Point(), _aIntroBmp ); _vdev->DrawBitmapEx( Point(), _aIntroBmp );
if (_bPaintProgress) { if (_bPaintProgress) {
// draw progress... // draw progress...
...@@ -623,20 +623,20 @@ void SplashScreen::Paint( const Rectangle&) ...@@ -623,20 +623,20 @@ void SplashScreen::Paint( const Rectangle&)
if (length < 0) length = 0; if (length < 0) length = 0;
// border // border
_vdev.SetFillColor(); _vdev->SetFillColor();
_vdev.SetLineColor( _cProgressFrameColor ); _vdev->SetLineColor( _cProgressFrameColor );
_vdev.DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight)); _vdev->DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight));
_vdev.SetFillColor( _cProgressBarColor ); _vdev->SetFillColor( _cProgressBarColor );
_vdev.SetLineColor(); _vdev->SetLineColor();
_vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace)); _vdev->DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace));
vcl::Font aFont; vcl::Font aFont;
aFont.SetSize(Size(0, 12)); aFont.SetSize(Size(0, 12));
aFont.SetAlign(ALIGN_BASELINE); aFont.SetAlign(ALIGN_BASELINE);
_vdev.SetFont(aFont); _vdev->SetFont(aFont);
_vdev.SetTextColor(_cProgressTextColor); _vdev->SetTextColor(_cProgressTextColor);
_vdev.DrawText(Point(_tlx, _textBaseline), _sProgressText); _vdev->DrawText(Point(_tlx, _textBaseline), _sProgressText);
} }
DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev.GetOutputSizePixel(), _vdev ); DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev->GetOutputSizePixel(), *_vdev.get() );
} }
......
...@@ -640,12 +640,12 @@ void LwpPageLayout::GetWidthAndHeight(double& fWidth, double& fHeight) ...@@ -640,12 +640,12 @@ void LwpPageLayout::GetWidthAndHeight(double& fWidth, double& fHeight)
if(GetUsePrinterSettings()) if(GetUsePrinterSettings())
{ {
//replaced by printer paper size //replaced by printer paper size
Printer aPrinter; ScopedVclPtr<Printer> pPrinter( new Printer() );
bool bScreen = aPrinter.IsDisplayPrinter(); bool bScreen = pPrinter->IsDisplayPrinter();
if (!bScreen)//Printer available if (!bScreen)//Printer available
{ {
Size aPaperSize = aPrinter.GetPaperSize(); Size aPaperSize = pPrinter->GetPaperSize();
aPaperSize = aPrinter.PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) ); aPaperSize = pPrinter->PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) );
fWidth = static_cast<double>(aPaperSize.Width())/100; //cm unit fWidth = static_cast<double>(aPaperSize.Width())/100; //cm unit
fHeight = static_cast<double>(aPaperSize.Height())/100; fHeight = static_cast<double>(aPaperSize.Height())/100;
} }
......
...@@ -395,15 +395,15 @@ void BackingWindow::Paint( const Rectangle& ) ...@@ -395,15 +395,15 @@ void BackingWindow::Paint( const Rectangle& )
DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack ); DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack );
Pop(); Pop();
VirtualDevice aDev( *this ); ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) );
aDev.EnableRTL( IsRTLEnabled() ); pVDev->EnableRTL( IsRTLEnabled() );
aDev.SetOutputSizePixel( maStartCentButtons.GetSize() ); pVDev->SetOutputSizePixel( maStartCentButtons.GetSize() );
Point aOffset( Point( 0, 0 ) - maStartCentButtons.TopLeft()); Point aOffset( Point( 0, 0 ) - maStartCentButtons.TopLeft());
aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack ); pVDev->DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
DrawOutDev( maStartCentButtons.TopLeft(), maStartCentButtons.GetSize(), DrawOutDev( maStartCentButtons.TopLeft(), maStartCentButtons.GetSize(),
Point( 0, 0 ), maStartCentButtons.GetSize(), Point( 0, 0 ), maStartCentButtons.GetSize(),
aDev ); *pVDev.get() );
} }
bool BackingWindow::PreNotify( NotifyEvent& rNEvt ) bool BackingWindow::PreNotify( NotifyEvent& rNEvt )
......
...@@ -127,11 +127,11 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const ...@@ -127,11 +127,11 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
std::shared_ptr<GDIMetaFile> xFile(new GDIMetaFile); std::shared_ptr<GDIMetaFile> xFile(new GDIMetaFile);
VirtualDevice aDevice; ScopedVclPtr<VirtualDevice> pDevice( new VirtualDevice() );
aDevice.EnableOutput( false ); pDevice->EnableOutput( false );
MapMode aMode( this->GetMapUnit() ); MapMode aMode( this->GetMapUnit() );
aDevice.SetMapMode( aMode ); pDevice->SetMapMode( aMode );
xFile->SetPrefMapMode( aMode ); xFile->SetPrefMapMode( aMode );
Size aTmpSize; Size aTmpSize;
...@@ -151,7 +151,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const ...@@ -151,7 +151,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(), DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(),
"size of first page is 0, override GetFirstPageSize or set vis-area!" ); "size of first page is 0, override GetFirstPageSize or set vis-area!" );
xFile->Record( &aDevice ); xFile->Record( pDevice );
LanguageType eLang; LanguageType eLang;
SvtCTLOptions aCTLOptions; SvtCTLOptions aCTLOptions;
...@@ -162,9 +162,9 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const ...@@ -162,9 +162,9 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
else else
eLang = (LanguageType) Application::GetSettings().GetLanguageTag().getLanguageType(); eLang = (LanguageType) Application::GetSettings().GetLanguageTag().getLanguageType();
aDevice.SetDigitLanguage( eLang ); pDevice->SetDigitLanguage( eLang );
const_cast<SfxObjectShell*>(this)->DoDraw( &aDevice, Point(0,0), aTmpSize, JobSetup(), nAspect ); const_cast<SfxObjectShell*>(this)->DoDraw( pDevice, Point(0,0), aTmpSize, JobSetup(), nAspect );
xFile->Stop(); xFile->Stop();
......
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