diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-20 14:27:53 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 13:01:47 +0100 |
commit | 52789497db9f97beb8c95177fd2293287c5dc1e6 (patch) | |
tree | 48e5c0ca0c7c433be7c0fd7bd638a50b52f945a9 | |
parent | 98586079c3961f32d9eaee9731ee053bc8bf1887 (diff) |
wrap more stuff in VclPtr
Change-Id: Ia742c47399231bc5914b6586132ad3daf694fdb0
-rw-r--r-- | canvas/source/vcl/backbuffer.hxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/vclwidgets.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/epict/epict.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvruler.cxx | 54 | ||||
-rw-r--r-- | sc/source/ui/inc/autofmt.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/autofmt.cxx | 34 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellLineStyleValueSet.cxx | 2 | ||||
-rw-r--r-- | sw/inc/hints.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/attr/hints.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/virtoutp.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/virtoutp.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/itratr.cxx | 4 | ||||
-rw-r--r-- | vcl/source/filter/wmf/emfwr.hxx | 4 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 3 |
17 files changed, 69 insertions, 71 deletions
diff --git a/canvas/source/vcl/backbuffer.hxx b/canvas/source/vcl/backbuffer.hxx index 479f4dd3983b..0beeda2e0467 100644 --- a/canvas/source/vcl/backbuffer.hxx +++ b/canvas/source/vcl/backbuffer.hxx @@ -43,7 +43,7 @@ namespace vclcanvas */ BackBuffer( const OutputDevice& rRefDevice, bool bMonochromeBuffer=false ); - ~BackBuffer(); + virtual ~BackBuffer(); virtual OutputDevice& getOutDev() SAL_OVERRIDE; virtual const OutputDevice& getOutDev() const SAL_OVERRIDE; diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx index ffa73a85f451..092770db5051 100644 --- a/compilerplugins/clang/vclwidgets.cxx +++ b/compilerplugins/clang/vclwidgets.cxx @@ -243,6 +243,8 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) { && !startsWith(pVarDecl->getType().getAsString(), "::std::multimap<sal_Int32, class OTableWindow *>") && !startsWith(pVarDecl->getType().getAsString(), "::dbp::OMultiInstanceAutoRegistration< ::dbp::OUnoAutoPilot<") && !startsWith(pVarDecl->getType().getAsString(), "SwSidebarWin_iterator") + && !startsWith(pVarDecl->getType().getAsString(), "functor_vector_type") + && !startsWith(pVarDecl->getType().getAsString(), "const functor_vector_type") && containsWindowSubclass(pVarDecl->getType())) { report( diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index 33f5fdbad813..df3a4f6cfcda 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -1854,24 +1854,24 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF ) case META_GRADIENT_ACTION: { - VirtualDevice aVDev; + ScopedVclPtr<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; + ScopedVclPtr<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/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 3b525ed59e01..d0e181b43491 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -401,7 +401,7 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ ) Size aSliderWindowSize = GetOutputSizePixel(); Rectangle aRect( Point( 0, 0 ), aSliderWindowSize ); - VirtualDevice* pVDev = new VirtualDevice( *this ); + ScopedVclPtr<VirtualDevice> pVDev = new VirtualDevice( *this ); pVDev->SetOutputSizePixel( aSliderWindowSize ); Rectangle aSlider = aRect; @@ -484,9 +484,6 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ ) pVDev->DrawImage( aImagePoint, mpImpl->maIncreaseButton ); DrawOutDev( Point(0, 0), aSliderWindowSize, Point(0, 0), aSliderWindowSize, *pVDev ); - - delete pVDev; - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index b464c874c9ad..4057831ea94b 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -93,8 +93,8 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) : EnableRTL( false ); // RTL InitColors(); InitSizeData(); - maBackgrDev.SetFont( GetFont() ); - maRulerDev.SetFont( GetFont() ); + maBackgrDev->SetFont( GetFont() ); + maRulerDev->SetFont( GetFont() ); load_FixedWidthList( maSplits ); } @@ -165,8 +165,8 @@ void ScCsvRuler::InitSizeData() maActiveRect.SetPos( Point( GetFirstX(), (GetHeight() - nActiveHeight - 1) / 2 ) ); maActiveRect.SetSize( Size( nActiveWidth, nActiveHeight ) ); - maBackgrDev.SetOutputSizePixel( maWinSize ); - maRulerDev.SetOutputSizePixel( maWinSize ); + maBackgrDev->SetOutputSizePixel( maWinSize ); + maRulerDev->SetOutputSizePixel( maWinSize ); InvalidateGfx(); } @@ -533,30 +533,30 @@ void ScCsvRuler::ImplRedraw() ImplDrawBackgrDev(); ImplDrawRulerDev(); } - DrawOutDev( Point(), maWinSize, Point(), maWinSize, maRulerDev ); + DrawOutDev( Point(), maWinSize, Point(), maWinSize, *maRulerDev.get() ); ImplDrawTrackingRect(); } } void ScCsvRuler::ImplDrawArea( sal_Int32 nPosX, sal_Int32 nWidth ) { - maBackgrDev.SetLineColor(); + maBackgrDev->SetLineColor(); Rectangle aRect( Point( nPosX, 0 ), Size( nWidth, GetHeight() ) ); - maBackgrDev.SetFillColor( maBackColor ); - maBackgrDev.DrawRect( aRect ); + maBackgrDev->SetFillColor( maBackColor ); + maBackgrDev->DrawRect( aRect ); aRect = maActiveRect; aRect.Left() = std::max( GetFirstX(), nPosX ); aRect.Right() = std::min( std::min( GetX( GetPosCount() ), GetLastX() ), nPosX + nWidth - sal_Int32( 1 ) ); if( aRect.Left() <= aRect.Right() ) { - maBackgrDev.SetFillColor( maActiveColor ); - maBackgrDev.DrawRect( aRect ); + maBackgrDev->SetFillColor( maActiveColor ); + maBackgrDev->DrawRect( aRect ); } - maBackgrDev.SetLineColor( maTextColor ); + maBackgrDev->SetLineColor( maTextColor ); sal_Int32 nY = GetHeight() - 1; - maBackgrDev.DrawLine( Point( nPosX, nY ), Point( nPosX + nWidth - 1, nY ) ); + maBackgrDev->DrawLine( Point( nPosX, nY ), Point( nPosX + nWidth - 1, nY ) ); } void ScCsvRuler::ImplDrawBackgrDev() @@ -564,8 +564,8 @@ void ScCsvRuler::ImplDrawBackgrDev() ImplDrawArea( 0, GetWidth() ); // scale - maBackgrDev.SetLineColor( maTextColor ); - maBackgrDev.SetFillColor(); + maBackgrDev->SetLineColor( maTextColor ); + maBackgrDev->SetFillColor(); sal_Int32 nPos; sal_Int32 nFirstPos = std::max( GetPosFromX( 0 ) - (sal_Int32)(1L), (sal_Int32)(0L) ); @@ -575,21 +575,21 @@ void ScCsvRuler::ImplDrawBackgrDev() { sal_Int32 nX = GetX( nPos ); if( nPos % 5 ) - maBackgrDev.DrawPixel( Point( nX, nY ) ); + maBackgrDev->DrawPixel( Point( nX, nY ) ); else - maBackgrDev.DrawLine( Point( nX, nY - 1 ), Point( nX, nY + 1 ) ); + maBackgrDev->DrawLine( Point( nX, nY - 1 ), Point( nX, nY + 1 ) ); } // texts - maBackgrDev.SetTextColor( maTextColor ); - maBackgrDev.SetTextFillColor(); + maBackgrDev->SetTextColor( maTextColor ); + maBackgrDev->SetTextFillColor(); for( nPos = ((nFirstPos + 9) / 10) * 10; nPos <= nLastPos; nPos += 10 ) { OUString aText( OUString::number( nPos ) ); - sal_Int32 nTextWidth = maBackgrDev.GetTextWidth( aText ); + sal_Int32 nTextWidth = maBackgrDev->GetTextWidth( aText ); sal_Int32 nTextX = GetX( nPos ) - nTextWidth / 2; ImplDrawArea( nTextX - 1, nTextWidth + 2 ); - maBackgrDev.DrawText( Point( nTextX, maActiveRect.Top() ), aText ); + maBackgrDev->DrawText( Point( nTextX, maActiveRect.Top() ), aText ); } } @@ -599,10 +599,10 @@ void ScCsvRuler::ImplDrawSplit( sal_Int32 nPos ) { Point aPos( GetX( nPos ) - mnSplitSize / 2, GetHeight() - mnSplitSize - 2 ); Size aSize( mnSplitSize, mnSplitSize ); - maRulerDev.SetLineColor( maTextColor ); - maRulerDev.SetFillColor( maSplitColor ); - maRulerDev.DrawEllipse( Rectangle( aPos, aSize ) ); - maRulerDev.DrawPixel( Point( GetX( nPos ), GetHeight() - 2 ) ); + maRulerDev->SetLineColor( maTextColor ); + maRulerDev->SetFillColor( maSplitColor ); + maRulerDev->DrawEllipse( Rectangle( aPos, aSize ) ); + maRulerDev->DrawPixel( Point( GetX( nPos ), GetHeight() - 2 ) ); } } @@ -613,14 +613,14 @@ void ScCsvRuler::ImplEraseSplit( sal_Int32 nPos ) ImplInvertCursor( GetRulerCursorPos() ); Point aPos( GetX( nPos ) - mnSplitSize / 2, 0 ); Size aSize( mnSplitSize, GetHeight() ); - maRulerDev.DrawOutDev( aPos, aSize, aPos, aSize, maBackgrDev ); + maRulerDev->DrawOutDev( aPos, aSize, aPos, aSize, *maBackgrDev.get() ); ImplInvertCursor( GetRulerCursorPos() ); } } void ScCsvRuler::ImplDrawRulerDev() { - maRulerDev.DrawOutDev( Point(), maWinSize, Point(), maWinSize, maBackgrDev ); + maRulerDev->DrawOutDev( Point(), maWinSize, Point(), maWinSize, *maBackgrDev.get() ); ImplInvertCursor( GetRulerCursorPos() ); sal_uInt32 nFirst = maSplits.LowerBound( GetFirstVisPos() ); @@ -634,7 +634,7 @@ void ScCsvRuler::ImplInvertCursor( sal_Int32 nPos ) { if( IsVisibleSplitPos( nPos ) ) { - ImplInvertRect( maRulerDev, Rectangle( Point( GetX( nPos ) - 1, 0 ), Size( 3, GetHeight() - 1 ) ) ); + ImplInvertRect( *maRulerDev.get(), Rectangle( Point( GetX( nPos ) - 1, 0 ), Size( 3, GetHeight() - 1 ) ) ); if( HasSplit( nPos ) ) ImplDrawSplit( nPos ); } diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx index 070ef9f586f7..3cd9bc37ac90 100644 --- a/sc/source/ui/inc/autofmt.hxx +++ b/sc/source/ui/inc/autofmt.hxx @@ -56,7 +56,7 @@ protected: private: ScAutoFormatData* pCurData; - VirtualDevice aVD; + ScopedVclPtr<VirtualDevice> aVD; SvtScriptedTextHelper aScriptedText; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBreakIter; bool bFitWidth; diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index 63c729b95791..b881e4e1f67b 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -57,8 +57,8 @@ ScAutoFmtPreview::ScAutoFmtPreview(vcl::Window* pParent) : Window(pParent) , pCurData(NULL) - , aVD(*this) - , aScriptedText(aVD) + , aVD(new VirtualDevice(*this)) + , aScriptedText(*aVD.get()) , bFitWidth(false) , mbRTL(false) , aStrJan(ScResId(STR_JAN)) @@ -382,11 +382,11 @@ void ScAutoFmtPreview::DrawBackground() const SvxBrushItem* pItem = static_cast< const SvxBrushItem* >( pCurData->GetItem( GetFormatIndex( nCol, nRow ), ATTR_BACKGROUND ) ); - aVD.Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR ); - aVD.SetLineColor(); - aVD.SetFillColor( pItem->GetColor() ); - aVD.DrawRect( maArray.GetCellRect( nCol, nRow ) ); - aVD.Pop(); + aVD->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR ); + aVD->SetLineColor(); + aVD->SetFillColor( pItem->GetColor() ); + aVD->DrawRect( maArray.GetCellRect( nCol, nRow ) ); + aVD->Pop(); } } } @@ -405,7 +405,7 @@ void ScAutoFmtPreview::PaintCells() // 3) border if ( pCurData->GetIncludeFrame() ) - maArray.DrawArray( aVD ); + maArray.DrawArray( *aVD.get() ); } } @@ -490,20 +490,20 @@ void ScAutoFmtPreview::NotifyChange( ScAutoFormatData* pNewData ) void ScAutoFmtPreview::DoPaint( const Rectangle& /* rRect */ ) { - sal_uInt32 nOldDrawMode = aVD.GetDrawMode(); + sal_uInt32 nOldDrawMode = aVD->GetDrawMode(); Size aWndSize( GetSizePixel() ); - vcl::Font aFont( aVD.GetFont() ); + vcl::Font aFont( aVD->GetFont() ); Color aBackCol( GetSettings().GetStyleSettings().GetWindowColor() ); Point aTmpPoint; Rectangle aRect( aTmpPoint, aWndSize ); aFont.SetTransparent( true ); - aVD.SetFont( aFont ); - aVD.SetLineColor(); - aVD.SetFillColor( aBackCol ); - aVD.SetOutputSize( aWndSize ); - aVD.DrawRect( aRect ); + aVD->SetFont( aFont ); + aVD->SetLineColor(); + aVD->SetFillColor( aBackCol ); + aVD->SetOutputSize( aWndSize ); + aVD->DrawRect( aRect ); PaintCells(); SetLineColor(); @@ -513,9 +513,9 @@ void ScAutoFmtPreview::DoPaint( const Rectangle& /* rRect */ ) Point aPos( (aWndSize.Width() - aPrvSize.Width()) / 2, (aWndSize.Height() - aPrvSize.Height()) / 2 ); if (AllSettings::GetLayoutRTL()) aPos.X() = -aPos.X(); - DrawOutDev( aPos, aWndSize, Point(), aWndSize, aVD ); + DrawOutDev( aPos, aWndSize, Point(), aWndSize, *aVD.get() ); - aVD.SetDrawMode( nOldDrawMode ); + aVD->SetDrawMode( nOldDrawMode ); } void ScAutoFmtPreview::Paint( const Rectangle& rRect ) diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx index 5ba64bdbced3..800c8b3ddc69 100644 --- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx +++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx @@ -39,7 +39,7 @@ CellLineStyleValueSet::~CellLineStyleValueSet() void CellLineStyleValueSet::dispose() { - delete pVDev; + pVDev.disposeAndClear(); ValueSet::dispose(); } diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx index c34a95b87f30..92a5744bbb7f 100644 --- a/sw/inc/hints.hxx +++ b/sw/inc/hints.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SW_INC_HINTS_HXX #include <swatrset.hxx> +#include <vcl/vclptr.hxx> #include <vector> class SwFmt; @@ -138,7 +139,7 @@ public: To get the page/chapter number, the frame has to be asked. For that we need the current OutputDevice. */ - SwRefMarkFldUpdate( const OutputDevice* ); + SwRefMarkFldUpdate( OutputDevice* ); }; /** SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx index 2aed42659232..129e9555ce15 100644 --- a/sw/source/core/attr/hints.cxx +++ b/sw/source/core/attr/hints.cxx @@ -49,7 +49,7 @@ SwUpdateAttr::SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW ) { } -SwRefMarkFldUpdate::SwRefMarkFldUpdate( const OutputDevice* pOutput ) +SwRefMarkFldUpdate::SwRefMarkFldUpdate( OutputDevice* pOutput ) : SwMsgPoolItem( RES_REFMARKFLD_UPDATE ), pOut( pOutput ) { diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 4d1557ebb1f1..9ae2b1952228 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -438,7 +438,7 @@ namespace private: bool mbMapModeRestored; - OutputDevice* mpOutDev; + VclPtr<OutputDevice> mpOutDev; }; } // <-- diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 6ad6d8350762..c22ab509338a 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -240,7 +240,7 @@ struct SwPaintProperties { // Only repaint the Fly content as well as the background of the Fly content if // a metafile is taken of the Fly. bool bSFlyMetafile; - OutputDevice *pSFlyMetafileOut; + VclPtr<OutputDevice> pSFlyMetafileOut; SwViewShell *pSGlobalShell; // Retouch for transparent Flys is done by the background of the Flys. @@ -1247,7 +1247,7 @@ void SwAlignRect( SwRect &rRect, const SwViewShell *pSh ) } const OutputDevice *pOut = gProp.bSFlyMetafile ? - gProp.pSFlyMetafileOut : pSh->GetOut(); + gProp.pSFlyMetafileOut.get() : pSh->GetOut(); // Hold original rectangle in pixel const Rectangle aOrgPxRect = pOut->LogicToPixel( rRect.SVRect() ); diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx index 78e5cfef4b23..dceabf01408d 100644 --- a/sw/source/core/layout/virtoutp.cxx +++ b/sw/source/core/layout/virtoutp.cxx @@ -133,8 +133,7 @@ bool SwLayVout::DoesFit( const Size &rNew ) aSize.Width() = rNew.Width(); if( !pVirDev->SetOutputSizePixel( aSize ) ) { - delete pVirDev; - pVirDev = NULL; + pVirDev.disposeAndClear(); aSize.Width() = 0; return false; } diff --git a/sw/source/core/layout/virtoutp.hxx b/sw/source/core/layout/virtoutp.hxx index 287cfaf10355..ea44b5be2b9f 100644 --- a/sw/source/core/layout/virtoutp.hxx +++ b/sw/source/core/layout/virtoutp.hxx @@ -43,7 +43,7 @@ private: public: SwLayVout() : pSh(0), pOut(0), pVirDev(0), aSize(0, VIRTUALHEIGHT), nCount(0) {} - ~SwLayVout() { delete pVirDev; } + ~SwLayVout() { pVirDev.disposeAndClear(); } /// OD 27.09.2002 #103636# - change 2nd parameter <rRect> - no longer <const> void Enter( SwViewShell *pShell, SwRect &rRect, bool bOn ); diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 38dc69ed5887..42cd02ac84f2 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -109,7 +109,7 @@ SwTxtAttr *SwAttrIter::GetAttr( const sal_Int32 nPosition ) const bool SwAttrIter::SeekAndChgAttrIter( const sal_Int32 nNewPos, OutputDevice* pOut ) { bool bChg = nStartIndex && nNewPos == nPos ? pFnt->IsFntChg() : Seek( nNewPos ); - if ( pLastOut != pOut ) + if ( pLastOut.get() != pOut ) { pLastOut = pOut; pFnt->SetFntChg( true ); @@ -174,7 +174,7 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo } bool bChg = pFnt->IsFntChg(); - if ( pLastOut != pOut ) + if ( pLastOut.get() != pOut ) { pLastOut = pOut; pFnt->SetFntChg( true ); diff --git a/vcl/source/filter/wmf/emfwr.hxx b/vcl/source/filter/wmf/emfwr.hxx index d4925c147147..3e9f2fc151fb 100644 --- a/vcl/source/filter/wmf/emfwr.hxx +++ b/vcl/source/filter/wmf/emfwr.hxx @@ -90,8 +90,8 @@ private: public: EMFWriter(SvStream &rStream) - : m_rStm(rStream) - , maVDev( new VirtualDevice() ) + : maVDev( new VirtualDevice() ) + , m_rStm(rStream) , mpHandlesUsed(NULL) , mnHandleCount(0) , mnRecordCount(0) diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index a7c0cfa503ff..d2170b34c1a4 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -774,7 +774,7 @@ public: void SizeAndRender(OutputDevice &rDev, const Rectangle& r, RenderType eType, const RenderContext &rCtx) { - VirtualDevice *pNested; + ScopedVclPtr<VirtualDevice> pNested; if ((int)eType < RENDER_AS_BITMAPEX) pNested = new VirtualDevice(rDev); @@ -804,7 +804,6 @@ public: aWhole.TopLeft(), aWhole.GetSize(), *pNested); } - delete pNested; } virtual void RenderRegion(OutputDevice &rDev, Rectangle r, const RenderContext &rCtx) SAL_OVERRIDE |