diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-19 14:38:23 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:13:36 +0100 |
commit | 057347dad41f7df3222cc483fdff83fa631606bb (patch) | |
tree | 0d34d8f77eaced4054ce6b16cddf0104f3bcdd6a /svx/source/unodraw | |
parent | 7a2e0a335593bcd04caf5ba3fd7a9b0e2d933567 (diff) |
Fix OutputDevice members / stack allocation.
Change-Id: Ie57434607b61085a882af40b63d6a4b7aac0d4d3
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 46 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 6 |
2 files changed, 26 insertions, 26 deletions
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index cc58203958b8..9c10297095c5 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -624,7 +624,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, if( !pPage ) return false; - VirtualDevice aVDev; + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY ); SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL); @@ -704,15 +704,15 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, boost::scoped_ptr< SdrView > pLocalView; if( PTR_CAST( FmFormModel, mpDoc ) ) { - pLocalView.reset( new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev ) ); + pLocalView.reset( new FmFormView( PTR_CAST( FmFormModel, mpDoc ), aVDev ) ); } else { - pLocalView.reset( new SdrView( mpDoc, &aVDev ) ); + pLocalView.reset( new SdrView( mpDoc, aVDev ) ); } - boost::scoped_ptr<VirtualDevice> pVDev(CreatePageVDev( pPage, nWidthPix, nHeightPix )); + ScopedVclPtr<VirtualDevice> pVDev(CreatePageVDev( pPage, nWidthPix, nHeightPix )); if( pVDev ) { @@ -726,22 +726,22 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, { GDIMetaFile aMtf; - aVDev.SetMapMode( aMap ); + aVDev->SetMapMode( aMap ); if( rSettings.mbUseHighContrast ) - aVDev.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ); - aVDev.EnableOutput( false ); - aMtf.Record( &aVDev ); + aVDev->SetDrawMode( aVDev->GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ); + aVDev->EnableOutput( false ); + aMtf.Record( aVDev ); Size aNewSize; // create a view boost::scoped_ptr< SdrView > pView; if( PTR_CAST( FmFormModel, mpDoc ) ) { - pView.reset(new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev )); + pView.reset(new FmFormView( PTR_CAST( FmFormModel, mpDoc ), aVDev )); } else { - pView.reset(new SdrView( mpDoc, &aVDev )); + pView.reset(new SdrView( mpDoc, aVDev )); } pView->SetBordVisible( false ); @@ -754,17 +754,17 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, const Rectangle aClipRect( aNewOrg, aNewSize ); MapMode aVMap( aMap ); - aVDev.Push(); + aVDev->Push(); aVMap.SetOrigin( Point( -aNewOrg.X(), -aNewOrg.Y() ) ); - aVDev.SetRelativeMapMode( aVMap ); - aVDev.IntersectClipRegion( aClipRect ); + aVDev->SetRelativeMapMode( aVMap ); + aVDev->IntersectClipRegion( aClipRect ); // Use new StandardCheckVisisbilityRedirector ImplExportCheckVisisbilityRedirector aRedirector( mpCurrentPage ); - pView->CompleteRedraw(&aVDev, vcl::Region(Rectangle(aNewOrg, aNewSize)), &aRedirector); + pView->CompleteRedraw(aVDev, vcl::Region(Rectangle(aNewOrg, aNewSize)), &aRedirector); - aVDev.Pop(); + aVDev->Pop(); aMtf.Stop(); aMtf.WindStart(); @@ -907,7 +907,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, if( !bSingleGraphic ) { // create a metafile for all shapes - VirtualDevice aOut; + ScopedVclPtr<VirtualDevice> aOut; // calculate bound rect for all shapes Rectangle aBound; @@ -927,18 +927,18 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, } } - aOut.EnableOutput( false ); - aOut.SetMapMode( aMap ); + aOut->EnableOutput( false ); + aOut->SetMapMode( aMap ); if( rSettings.mbUseHighContrast ) - aOut.SetDrawMode( aOut.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ); + aOut->SetDrawMode( aOut->GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ); GDIMetaFile aMtf; aMtf.Clear(); - aMtf.Record( &aOut ); + aMtf.Record( aOut ); MapMode aOutMap( aMap ); aOutMap.SetOrigin( Point( -aBound.TopLeft().X(), -aBound.TopLeft().Y() ) ); - aOut.SetRelativeMapMode( aOutMap ); + aOut->SetRelativeMapMode( aOutMap ); sdr::contact::DisplayInfo aDisplayInfo; @@ -956,7 +956,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, { // more effective way to paint a vector of SdrObjects. Hand over the processed page // to have it in the - sdr::contact::ObjectContactOfObjListPainter aMultiObjectPainter(aOut, aShapes, mpCurrentPage); + sdr::contact::ObjectContactOfObjListPainter aMultiObjectPainter(*aOut.get(), aShapes, mpCurrentPage); ImplExportCheckVisisbilityRedirector aCheckVisibilityRedirector(mpCurrentPage); aMultiObjectPainter.SetViewObjectContactRedirector(&aCheckVisibilityRedirector); @@ -966,7 +966,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aMtf.Stop(); aMtf.WindStart(); - const Size aExtSize( aOut.PixelToLogic( Size( 0, 0 ) ) ); + const Size aExtSize( aOut->PixelToLogic( Size( 0, 0 ) ) ); Size aBoundSize( aBound.GetWidth() + ( aExtSize.Width() ), aBound.GetHeight() + ( aExtSize.Height() ) ); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 58a3e7d14ff4..9c1981ee027f 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -670,13 +670,13 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const if( !mpObj.is() || mpModel == NULL || !mpObj->IsInserted() || NULL == mpObj->GetPage() ) return aAny; - VirtualDevice aVDev; - aVDev.SetMapMode(MapMode(MAP_100TH_MM)); + ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + pVDev->SetMapMode(MapMode(MAP_100TH_MM)); SdrModel* pModel = mpObj->GetModel(); SdrPage* pPage = mpObj->GetPage(); - boost::scoped_ptr<E3dView> pView(new E3dView( pModel, &aVDev )); + boost::scoped_ptr<E3dView> pView(new E3dView( pModel, pVDev.get() )); pView->hideMarkHandles(); SdrPageView* pPageView = pView->ShowSdrPage(pPage); |