diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 11:41:31 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 15:08:48 +0100 |
commit | e8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (patch) | |
tree | b322529f4a54a6427862cb20cb4cf87fb6a5d065 /filter/source/graphicfilter | |
parent | 2b0be6c0e9d23f1b8535ba7033732ae2e3bfb5c9 (diff) | |
parent | 0cde74f788a054fa2b65107a030dd463b8d11c7a (diff) |
Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.
Conflicts:
accessibility/source/extended/accessiblelistbox.cxx
accessibility/source/standard/vclxaccessiblecombobox.cxx
accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
accessibility/source/standard/vclxaccessiblelistbox.cxx
accessibility/source/standard/vclxaccessibletextfield.cxx
basctl/source/basicide/basidesh.cxx
cui/source/inc/chardlg.hxx
cui/source/tabpages/tpbitmap.cxx
dbaccess/source/ui/dlg/UserAdmin.cxx
dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
extensions/source/propctrlr/propertyeditor.hxx
extensions/source/scanner/sanedlg.cxx
filter/source/pdf/impdialog.cxx
include/sfx2/mgetempl.hxx
include/sfx2/sidebar/SidebarToolBox.hxx
include/sfx2/viewsh.hxx
include/svtools/brwbox.hxx
include/svtools/filectrl.hxx
include/svtools/scrwin.hxx
include/svx/dlgctrl.hxx
include/svx/sidebar/Popup.hxx
include/svx/sidebar/PopupContainer.hxx
include/svx/sidebar/PopupControl.hxx
include/svx/sidebar/SidebarDialControl.hxx
include/svx/sidebar/ValueSetWithTextControl.hxx
sc/source/ui/condformat/condformatdlgentry.cxx
sc/source/ui/navipi/navipi.cxx
sc/source/ui/sidebar/CellBorderStyleControl.hxx
sd/source/ui/animations/CustomAnimationDialog.cxx
sd/source/ui/inc/DrawViewShell.hxx
sd/source/ui/inc/Ruler.hxx
sd/source/ui/inc/SlideSorter.hxx
sd/source/ui/inc/ViewTabBar.hxx
sd/source/ui/inc/Window.hxx
sd/source/ui/inc/morphdlg.hxx
sd/source/ui/inc/sdpreslt.hxx
sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
sd/source/ui/sidebar/LayoutMenu.hxx
sd/source/ui/sidebar/MasterPagesSelector.hxx
sd/source/ui/sidebar/NavigatorWrapper.hxx
sd/source/ui/sidebar/PanelBase.hxx
sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
sd/source/ui/slideshow/showwindow.hxx
sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
sd/source/ui/view/ViewShellBase.cxx
sd/source/ui/view/drviewsa.cxx
sfx2/source/appl/fileobj.hxx
sfx2/source/appl/opengrf.cxx
sfx2/source/control/thumbnailviewacc.hxx
sfx2/source/dialog/securitypage.cxx
sfx2/source/dialog/templdlg.cxx
sfx2/source/doc/docinsert.cxx
sfx2/source/doc/guisaveas.cxx
sfx2/source/inc/alienwarn.hxx
sfx2/source/sidebar/Deck.cxx
sfx2/source/sidebar/Deck.hxx
sfx2/source/sidebar/DeckTitleBar.cxx
sfx2/source/sidebar/DeckTitleBar.hxx
sfx2/source/sidebar/MenuButton.cxx
sfx2/source/sidebar/MenuButton.hxx
sfx2/source/sidebar/Panel.cxx
sfx2/source/sidebar/Panel.hxx
sfx2/source/sidebar/PanelTitleBar.hxx
sfx2/source/sidebar/SidebarDockingWindow.hxx
sfx2/source/sidebar/SidebarToolBox.cxx
sfx2/source/sidebar/TabBar.hxx
sfx2/source/sidebar/TabItem.cxx
sfx2/source/sidebar/TabItem.hxx
sfx2/source/sidebar/TitleBar.hxx
sfx2/source/toolbox/imgmgr.cxx
starmath/inc/edit.hxx
starmath/inc/smmod.hxx
starmath/qa/cppunit/test_starmath.cxx
starmath/source/edit.cxx
starmath/source/smmod.cxx
svtools/source/brwbox/brwbox1.cxx
svtools/source/brwbox/datwin.hxx
svtools/source/contnr/fileview.cxx
svtools/source/contnr/simptabl.cxx
svtools/source/control/filectrl.cxx
svtools/source/control/valueimp.hxx
svx/inc/GalleryControl.hxx
svx/source/dialog/dlgctrl.cxx
svx/source/dialog/swframeexample.cxx
svx/source/fmcomp/fmgridif.cxx
svx/source/gallery2/GalleryControl.cxx
svx/source/sidebar/EmptyPanel.hxx
svx/source/sidebar/area/AreaPropertyPanel.hxx
svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
svx/source/sidebar/insert/InsertPropertyPanel.cxx
svx/source/sidebar/insert/InsertPropertyPanel.hxx
svx/source/sidebar/line/LinePropertyPanel.hxx
svx/source/sidebar/line/LineWidthControl.cxx
svx/source/sidebar/line/LineWidthControl.hxx
svx/source/sidebar/line/LineWidthValueSet.hxx
svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
svx/source/sidebar/possize/SidebarDialControl.cxx
svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
svx/source/sidebar/text/TextPropertyPanel.hxx
svx/source/sidebar/tools/PopupContainer.cxx
svx/source/sidebar/tools/PopupControl.cxx
svx/source/sidebar/tools/ValueSetWithTextControl.cxx
svx/source/svdraw/svdfmtf.hxx
svx/source/svdraw/svdibrow.cxx
svx/source/tbxctrls/colrctrl.cxx
svx/source/tbxctrls/tbcontrl.cxx
sw/source/ui/dbui/mmaddressblockpage.cxx
sw/source/ui/dialog/uiregionsw.cxx
sw/source/ui/index/cnttab.cxx
sw/source/uibase/inc/drpcps.hxx
sw/source/uibase/sidebar/PageColumnControl.hxx
sw/source/uibase/sidebar/PageMarginControl.hxx
sw/source/uibase/sidebar/PageOrientationControl.hxx
sw/source/uibase/sidebar/PagePropertyPanel.hxx
sw/source/uibase/sidebar/PageSizeControl.hxx
sw/source/uibase/uiview/view2.cxx
sw/source/uibase/utlui/navipi.cxx
vcl/inc/svdata.hxx
vcl/source/control/combobox.cxx
vcl/source/control/lstbox.cxx
vcl/source/window/dockwin.cxx
vcl/source/window/winproc.cxx
Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
Diffstat (limited to 'filter/source/graphicfilter')
-rw-r--r-- | filter/source/graphicfilter/eos2met/eos2met.cxx | 39 | ||||
-rw-r--r-- | filter/source/graphicfilter/epict/epict.cxx | 41 | ||||
-rw-r--r-- | filter/source/graphicfilter/eps/eps.cxx | 42 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/cgm.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/cgm.hxx | 3 | ||||
-rw-r--r-- | filter/source/graphicfilter/idxf/dxf2mtf.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/idxf/dxf2mtf.hxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/ieps/ieps.cxx | 36 | ||||
-rw-r--r-- | filter/source/graphicfilter/ios2met/ios2met.cxx | 6 | ||||
-rw-r--r-- | filter/source/graphicfilter/ipict/ipict.cxx | 6 |
10 files changed, 90 insertions, 89 deletions
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index 501a9a8ac31d..ef7b1307e1bf 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -156,8 +156,8 @@ private: sal_uInt32 nWrittenBitmaps; // number of already written Bitmaps sal_uInt32 nActBitmapPercent; // percentage of the next bitmap that's already written - ::std::unique_ptr< VirtualDevice > apDummyVDev; - OutputDevice* pCompDev; + ScopedVclPtr<VirtualDevice> apDummyVDev; + VclPtr<OutputDevice> pCompDev; com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator; @@ -261,6 +261,7 @@ public: pCompDev = reinterpret_cast< OutputDevice* >( Application::GetAppWindow() ); if( !pCompDev ) { + apDummyVDev.disposeAndClear(); apDummyVDev.reset( new VirtualDevice ); pCompDev = apDummyVDev.get(); } @@ -1850,12 +1851,12 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) if( aGDIFont.GetAlign() != ALIGN_BASELINE) { - VirtualDevice aVDev; + ScopedVclPtrInstance< VirtualDevice > pVDev; if( aGDIFont.GetAlign()==ALIGN_TOP ) - aPt.Y()+=(long)aVDev.GetFontMetric( aGDIFont ).GetAscent(); + aPt.Y()+=(long)pVDev->GetFontMetric( aGDIFont ).GetAscent(); else - aPt.Y()-=(long)aVDev.GetFontMetric( aGDIFont ).GetDescent(); + aPt.Y()-=(long)pVDev->GetFontMetric( aGDIFont ).GetDescent(); } METSetMix(eGDIRasterOp); @@ -1879,11 +1880,11 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) if( aGDIFont.GetAlign() != ALIGN_BASELINE ) { - VirtualDevice aVDev; + ScopedVclPtrInstance< VirtualDevice > pVDev; if( aGDIFont.GetAlign() == ALIGN_TOP ) - aPt.Y()+=(long)aVDev.GetFontMetric(aGDIFont).GetAscent(); + aPt.Y()+=(long)pVDev->GetFontMetric(aGDIFont).GetAscent(); else - aPt.Y()-=(long)aVDev.GetFontMetric(aGDIFont).GetDescent(); + aPt.Y()-=(long)pVDev->GetFontMetric(aGDIFont).GetDescent(); } METSetMix(eGDIRasterOp); @@ -1922,7 +1923,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) case META_STRETCHTEXT_ACTION: { const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pMA); - VirtualDevice aVDev; + ScopedVclPtrInstance< VirtualDevice > pVDev; sal_uInt16 i; sal_Int32 nNormSize; OUString aStr; @@ -1931,14 +1932,14 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) Point aPt( pA->GetPoint() ); Point aPt2; - aVDev.SetFont( aGDIFont ); + pVDev->SetFont( aGDIFont ); if( aGDIFont.GetAlign() != ALIGN_BASELINE) { if( aGDIFont.GetAlign() == ALIGN_TOP ) - aPt.Y()+=(long)aVDev.GetFontMetric().GetAscent(); + aPt.Y()+=(long)pVDev->GetFontMetric().GetAscent(); else - aPt.Y()-=(long)aVDev.GetFontMetric().GetDescent(); + aPt.Y()-=(long)pVDev->GetFontMetric().GetDescent(); } METSetMix(eGDIRasterOp); @@ -1949,7 +1950,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) METSetChrSet(FindChrSet(aGDIFont)); aStr = pA->GetText().copy(pA->GetIndex(),pA->GetLen()); boost::scoped_array<long> pDXAry(new long[aStr.getLength()]); - nNormSize = aVDev.GetTextArray( aStr, pDXAry.get() ); + nNormSize = pVDev->GetTextArray( aStr, pDXAry.get() ); for ( i = 0; i < aStr.getLength(); i++ ) { @@ -2067,24 +2068,24 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) case META_GRADIENT_ACTION: { - VirtualDevice aVDev; + ScopedVclPtrInstance< VirtualDevice > pVDev; GDIMetaFile aTmpMtf; const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pMA); - aVDev.SetMapMode( aTargetMapMode ); - aVDev.AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf ); + pVDev->SetMapMode( aTargetMapMode ); + pVDev->AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf ); WriteOrders( &aTmpMtf ); } break; case META_HATCH_ACTION: { - VirtualDevice aVDev; + ScopedVclPtrInstance< VirtualDevice > pVDev; GDIMetaFile aTmpMtf; const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pMA); - aVDev.SetMapMode( aTargetMapMode ); - aVDev.AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf ); + pVDev->SetMapMode( aTargetMapMode ); + pVDev->AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf ); WriteOrders( &aTmpMtf ); } break; diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index 6631bdfc3671..9bf395375689 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -1699,12 +1699,11 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) if ( aSrcFont.GetAlign() != ALIGN_BASELINE ) { - VirtualDevice aVirDev; - + ScopedVclPtrInstance< VirtualDevice > pVirDev; if (aSrcFont.GetAlign()==ALIGN_TOP) - aPt.Y()+=(long)aVirDev.GetFontMetric(aSrcFont).GetAscent(); + aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent(); else - aPt.Y()-=(long)aVirDev.GetFontMetric(aSrcFont).GetDescent(); + aPt.Y()-=(long)pVirDev->GetFontMetric(aSrcFont).GetDescent(); } SetAttrForText(); @@ -1720,12 +1719,12 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) if (aSrcFont.GetAlign()!=ALIGN_BASELINE) { - VirtualDevice aVirDev; + ScopedVclPtrInstance< VirtualDevice > pVirDev; if (aSrcFont.GetAlign()==ALIGN_TOP) - aPt.Y()+=(long)aVirDev.GetFontMetric(aSrcFont).GetAscent(); + aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent(); else - aPt.Y()-=(long)aVirDev.GetFontMetric(aSrcFont).GetDescent(); + aPt.Y()-=(long)pVirDev->GetFontMetric(aSrcFont).GetDescent(); } SetAttrForText(); OUString aStr = pA->GetText().copy( pA->GetIndex(),pA->GetLen() ); @@ -1738,16 +1737,16 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pMA); Point aPt( pA->GetPoint() ); OUString aStr = pA->GetText().copy( pA->GetIndex(),pA->GetLen() ); - VirtualDevice aVirDev; + ScopedVclPtrInstance< VirtualDevice > pVirDev; boost::scoped_array<long> pDXAry(new long[ aStr.getLength() ]); - sal_Int32 nNormSize( aVirDev.GetTextArray( aStr,pDXAry.get() ) ); + sal_Int32 nNormSize( pVirDev->GetTextArray( aStr,pDXAry.get() ) ); if (aSrcFont.GetAlign()!=ALIGN_BASELINE) { if (aSrcFont.GetAlign()==ALIGN_TOP) - aPt.Y()+=(long)aVirDev.GetFontMetric(aSrcFont).GetAscent(); + aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent(); else - aPt.Y()-=(long)aVirDev.GetFontMetric(aSrcFont).GetDescent(); + aPt.Y()-=(long)pVirDev->GetFontMetric(aSrcFont).GetDescent(); } sal_Int32 nLength = aStr.getLength() - 1; @@ -1774,9 +1773,9 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) { const MetaBmpAction* pA = static_cast<const MetaBmpAction*>(pMA); const Bitmap aBmp( pA->GetBitmap() ); - VirtualDevice aVirDev; + ScopedVclPtrInstance< VirtualDevice > pVirDev; - WriteOpcode_BitsRect( pA->GetPoint(), aVirDev.PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp ); + WriteOpcode_BitsRect( pA->GetPoint(), pVirDev->PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp ); } break; @@ -1801,9 +1800,9 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) { const MetaBmpExAction* pA = static_cast<const MetaBmpExAction*>(pMA); const Bitmap aBmp( Graphic( pA->GetBitmapEx() ).GetBitmap() ); - VirtualDevice aVirDev; + ScopedVclPtrInstance< VirtualDevice > pVirDev; - WriteOpcode_BitsRect( pA->GetPoint(), aVirDev.PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp ); + WriteOpcode_BitsRect( pA->GetPoint(), pVirDev->PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp ); } break; @@ -1855,24 +1854,24 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) case META_GRADIENT_ACTION: { - VirtualDevice aVDev; + ScopedVclPtrInstance<VirtualDevice> aVDev; GDIMetaFile aTmpMtf; const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pMA); - aVDev.SetMapMode( aTargetMapMode ); - aVDev.AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf ); + aVDev->SetMapMode( aTargetMapMode ); + aVDev->AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf ); WriteOpcodes( aTmpMtf ); } break; case META_HATCH_ACTION: { - VirtualDevice aVDev; + ScopedVclPtrInstance<VirtualDevice> aVDev; GDIMetaFile aTmpMtf; const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pMA); - aVDev.SetMapMode( aTargetMapMode ); - aVDev.AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf ); + aVDev->SetMapMode( aTargetMapMode ); + aVDev->AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf ); WriteOpcodes( aTmpMtf ); } break; diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index cfe790a290f3..20f6a2f9d1d3 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -116,7 +116,7 @@ private: SvStream* mpPS; const GDIMetaFile* pMTF; GDIMetaFile* pAMTF; // only created if Graphics is not a Metafile - VirtualDevice aVDev; + ScopedVclPtr<VirtualDevice> pVDev; double nBoundingX1; // this represents the bounding box double nBoundingY1; @@ -257,7 +257,7 @@ PSWriter::PSWriter() , mpPS(NULL) , pMTF(NULL) , pAMTF(NULL) - , aVDev() + , pVDev() , nBoundingX1(0) , nBoundingY1(0) , nBoundingX2(0) @@ -418,14 +418,14 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter { Bitmap aBmp( rGraphic.GetBitmap() ); pAMTF = new GDIMetaFile(); - VirtualDevice aTmpVDev; - pAMTF->Record( &aTmpVDev ); - aTmpVDev.DrawBitmap( Point(), aBmp ); + ScopedVclPtrInstance< VirtualDevice > pTmpVDev; + pAMTF->Record( pTmpVDev ); + pTmpVDev->DrawBitmap( Point(), aBmp ); pAMTF->Stop(); pAMTF->SetPrefSize( aBmp.GetSizePixel() ); pMTF = pAMTF; } - aVDev.SetMapMode( pMTF->GetPrefMapMode() ); + pVDev->SetMapMode( pMTF->GetPrefMapMode() ); nBoundingX1 = nBoundingY1 = 0; nBoundingX2 = pMTF->GetPrefSize().Width(); nBoundingY2 = pMTF->GetPrefSize().Height(); @@ -454,7 +454,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter { ImplWriteProlog( ( mnPreview & EPS_PREVIEW_EPSI ) ? &rGraphic : NULL ); mnCursorPos = 0; - ImplWriteActions( *pMTF, aVDev ); + ImplWriteActions( *pMTF, *pVDev.get() ); ImplWriteEpilog(); if ( mnPreview & EPS_PREVIEW_TIFF ) { @@ -486,8 +486,8 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag() ); if( pResMgr ) { - InfoBox aInfoBox( NULL, ResId(KEY_VERSION_CHECK, *pResMgr).toString() ); - aInfoBox.Execute(); + ScopedVclPtrInstance< InfoBox > aInfoBox( nullptr, ResId(KEY_VERSION_CHECK, *pResMgr).toString() ); + aInfoBox->Execute(); delete pResMgr; } } @@ -940,12 +940,12 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) case META_HATCH_ACTION : { - VirtualDevice l_aVDev; + ScopedVclPtrInstance< VirtualDevice > l_pVirDev; GDIMetaFile aTmpMtf; - l_aVDev.SetMapMode( rVDev.GetMapMode() ); - l_aVDev.AddHatchActions( static_cast<const MetaHatchAction*>(pMA)->GetPolyPolygon(), - static_cast<const MetaHatchAction*>(pMA)->GetHatch(), aTmpMtf ); + l_pVirDev->SetMapMode( rVDev.GetMapMode() ); + l_pVirDev->AddHatchActions( static_cast<const MetaHatchAction*>(pMA)->GetPolyPolygon(), + static_cast<const MetaHatchAction*>(pMA)->GetHatch(), aTmpMtf ); ImplWriteActions( aTmpMtf, rVDev ); } break; @@ -1608,10 +1608,10 @@ void PSWriter::ImplIntersect( const tools::PolyPolygon& rPolyPoly ) void PSWriter::ImplWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, VirtualDevice& rVDev ) { - VirtualDevice l_aVDev; + ScopedVclPtrInstance< VirtualDevice > l_pVDev; GDIMetaFile aTmpMtf; - l_aVDev.SetMapMode( rVDev.GetMapMode() ); - l_aVDev.AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf ); + l_pVDev->SetMapMode( rVDev.GetMapMode() ); + l_pVDev->AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf ); ImplWriteActions( aTmpMtf, rVDev ); } @@ -2141,10 +2141,10 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo vcl::Font aNotRotatedFont( maFont ); aNotRotatedFont.SetOrientation( 0 ); - VirtualDevice aVirDev( 1 ); - aVirDev.SetMapMode( rVDev.GetMapMode() ); - aVirDev.SetFont( aNotRotatedFont ); - aVirDev.SetTextAlign( eTextAlign ); + ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 ); + pVirDev->SetMapMode( rVDev.GetMapMode() ); + pVirDev->SetFont( aNotRotatedFont ); + pVirDev->SetTextAlign( eTextAlign ); sal_Int16 nRotation = maFont.GetOrientation(); Polygon aPolyDummy( 1 ); @@ -2159,7 +2159,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo bool bOldLineColor = bLineColor; bLineColor = false; std::vector<tools::PolyPolygon> aPolyPolyVec; - if ( aVirDev.GetTextOutlines( aPolyPolyVec, rUniString, 0, 0, -1, true, nWidth, pDXArry ) ) + if ( pVirDev->GetTextOutlines( aPolyPolyVec, rUniString, 0, 0, -1, true, nWidth, pDXArry ) ) { // always adjust text position to match baseline alignment ImplWriteLine( "pum" ); diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index 55a6158e8b46..30c8c474f7ee 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -80,7 +80,7 @@ CGM::~CGM() mpGDIMetaFile->Stop(); mpGDIMetaFile->SetPrefMapMode( MapMode() ); mpGDIMetaFile->SetPrefSize( Size( static_cast< long >( mnOutdx ), static_cast< long >( mnOutdy ) ) ); - delete mpVirDev; + mpVirDev.disposeAndClear(); *mpGraphic = Graphic( *mpGDIMetaFile ); } for( size_t i = 0, n = maDefRepList.size(); i < n; ++i ) diff --git a/filter/source/graphicfilter/icgm/cgm.hxx b/filter/source/graphicfilter/icgm/cgm.hxx index 1ee13eaf9a6b..f9e6fa455325 100644 --- a/filter/source/graphicfilter/icgm/cgm.hxx +++ b/filter/source/graphicfilter/icgm/cgm.hxx @@ -28,6 +28,7 @@ #include <rtl/ustring.hxx> #include <vector> +#include <vcl/vclptr.hxx> #include "cgmtypes.hxx" class Graphic; @@ -138,7 +139,7 @@ class CGM ~CGM(); CGM( sal_uInt32 nMode, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > const & rModel ); - VirtualDevice* mpVirDev; + VclPtr<VirtualDevice> mpVirDev; GDIMetaFile* mpGDIMetaFile; sal_uInt32 GetBackGroundColor(); bool IsValid() const { return mbStatus; }; diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index bacd08189425..ffca879871cb 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -885,7 +885,7 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF rMTF.SetPrefMapMode( MapMode( MAP_100TH_MM ) ); } - delete pVirDev; + pVirDev.disposeAndClear(); return bStatus; } diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.hxx b/filter/source/graphicfilter/idxf/dxf2mtf.hxx index 3adc4eee9aff..e88fcc3c9f27 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.hxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.hxx @@ -34,7 +34,7 @@ enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT, class DXF2GDIMetaFile { private: - VirtualDevice * pVirDev; + VclPtr<VirtualDevice> pVirDev; const DXFRepresentation * pDXF; bool bStatus; diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index b933574f4ed8..503606dd4977 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -125,7 +125,7 @@ static int ImplGetLen( sal_uInt8* pBuf, int nMax ) static void MakeAsMeta(Graphic &rGraphic) { - VirtualDevice aVDev; + ScopedVclPtrInstance< VirtualDevice > pVDev; GDIMetaFile aMtf; Bitmap aBmp( rGraphic.GetBitmap() ); Size aSize = aBmp.GetPrefSize(); @@ -137,9 +137,9 @@ static void MakeAsMeta(Graphic &rGraphic) aSize = OutputDevice::LogicToLogic( aSize, aBmp.GetPrefMapMode(), MAP_100TH_MM ); - aVDev.EnableOutput( false ); - aMtf.Record( &aVDev ); - aVDev.DrawBitmap( Point(), aSize, rGraphic.GetBitmap() ); + pVDev->EnableOutput( false ); + aMtf.Record( pVDev ); + pVDev->DrawBitmap( Point(), aSize, rGraphic.GetBitmap() ); aMtf.Stop(); aMtf.WindStart(); aMtf.SetPrefMapMode( MAP_100TH_MM ); @@ -442,22 +442,22 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, long nWidth, long nHeight, Graphic &rGraphic) { GDIMetaFile aMtf; - VirtualDevice aVDev; + ScopedVclPtrInstance< VirtualDevice > pVDev; vcl::Font aFont; - aVDev.EnableOutput( false ); - aMtf.Record( &aVDev ); - aVDev.SetLineColor( Color( COL_RED ) ); - aVDev.SetFillColor(); + pVDev->EnableOutput( false ); + aMtf.Record( pVDev ); + pVDev->SetLineColor( Color( COL_RED ) ); + pVDev->SetFillColor(); aFont.SetColor( COL_LIGHTRED ); // aFont.SetSize( Size( 0, 32 ) ); - aVDev.Push( PushFlags::FONT ); - aVDev.SetFont( aFont ); + pVDev->Push( PushFlags::FONT ); + pVDev->SetFont( aFont ); Rectangle aRect( Point( 1, 1 ), Size( nWidth - 2, nHeight - 2 ) ); - aVDev.DrawRect( aRect ); + pVDev->DrawRect( aRect ); OUString aString; int nLen; @@ -511,8 +511,8 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, aString += " LanguageLevel:" + OUString::number( nNumber ); } } - aVDev.DrawText( aRect, aString, TEXT_DRAW_CLIP | TEXT_DRAW_MULTILINE ); - aVDev.Pop(); + pVDev->DrawText( aRect, aString, TEXT_DRAW_CLIP | TEXT_DRAW_MULTILINE ); + pVDev->Pop(); aMtf.Stop(); aMtf.WindStart(); aMtf.SetPrefMapMode( MAP_POINT ); @@ -679,17 +679,17 @@ GraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) } if ( bIsValid ) { - VirtualDevice aVDev; + ScopedVclPtrInstance<VirtualDevice> pVDev; GDIMetaFile aMtf; Size aSize; - aVDev.EnableOutput( false ); - aMtf.Record( &aVDev ); + pVDev->EnableOutput( false ); + aMtf.Record( pVDev ); aSize = aBitmap.GetPrefSize(); if( !aSize.Width() || !aSize.Height() ) aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MAP_100TH_MM ); else aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MAP_100TH_MM ); - aVDev.DrawBitmap( Point(), aSize, aBitmap ); + pVDev->DrawBitmap( Point(), aSize, aBitmap ); aMtf.Stop(); aMtf.WindStart(); aMtf.SetPrefMapMode( MAP_100TH_MM ); diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 435a6e164597..7b024ae84eb3 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -345,7 +345,7 @@ private: long ErrorCode; SvStream * pOS2MET; // the OS2MET file to be read - VirtualDevice * pVirDev; // here the drawing methods are being called + VclPtr<VirtualDevice> pVirDev; // here the drawing methods are being called // While doing this a recording in the GDIMetaFile // will take place. sal_uLong nOrigPos; // initial position in pOS2MET @@ -2601,7 +2601,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF pOrdFile=NULL; - pVirDev = new VirtualDevice(); + pVirDev = VclPtr<VirtualDevice>::Create(); pVirDev->EnableOutput(false); rGDIMetaFile.Record(pVirDev); @@ -2657,7 +2657,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF } rGDIMetaFile.Stop(); - delete pVirDev; + pVirDev.disposeAndClear(); rGDIMetaFile.SetPrefMapMode( aGlobMapMode ); diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index badebaf82c3a..6621eddd3c60 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -146,7 +146,7 @@ class PictReader { private: SvStream * pPict; // The Pict file to read. - VirtualDevice * pVirDev; // Here the drawing methos will be called. + VclPtr<VirtualDevice> pVirDev; // Here the drawing methos will be called. // A recording into the GDIMetaFile will take place. sal_uLong nOrigPos; // Initial position in pPict. @@ -1881,7 +1881,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) aHRes = aVRes = Fraction( 1, 1 ); - pVirDev = new VirtualDevice(); + pVirDev = VclPtr<VirtualDevice>::Create(); pVirDev->EnableOutput(false); rGDIMetaFile.Record(pVirDev); @@ -1942,7 +1942,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) pVirDev->SetClipRegion(); rGDIMetaFile.Stop(); - delete pVirDev; + pVirDev.disposeAndClear(); rGDIMetaFile.SetPrefMapMode( MapMode( MAP_INCH, Point(), aHRes, aVRes ) ); rGDIMetaFile.SetPrefSize( aBoundingRect.GetSize() ); |