diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-20 18:58:34 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 13:01:49 +0100 |
commit | ad8a2074c6143d3ce05c0a5d93a553c13b950520 (patch) | |
tree | 2f47189a78e80d478a15a3360906131fc9c16428 /vcl | |
parent | 8fb4672aef888fc5a582ca9508799ecdbe777c42 (diff) |
cure a lot of unfortunate ScopedVclPtrs.
Change-Id: I2149511f958ba75e81dc41b10b01eb9d19610037
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/sgfbram.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/sgvmain.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/sgvtext.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/cvtsvm.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/gdimetafiletools.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 14 | ||||
-rw-r--r-- | vcl/source/gdi/impanmvw.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impvect.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print2.cxx | 6 | ||||
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/transparent.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/wallpaper.cxx | 2 |
15 files changed, 25 insertions, 25 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 18cd8dddc936..8cc8d9d5770a 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1892,7 +1892,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString { Size aSizePixel; sal_uLong nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; - ScopedVclPtr<VirtualDevice> aVirDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aVirDev( new VirtualDevice() ); nMaxMem = 1024; nMaxMem *= 1024; // In Bytes diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx index d0fe0f13bbf4..95ae3fad1984 100644 --- a/vcl/source/filter/sgfbram.cxx +++ b/vcl/source/filter/sgfbram.cxx @@ -390,7 +390,7 @@ Color Hpgl2SvFarbe( sal_uInt8 nFarb ) bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf) { - ScopedVclPtr<VirtualDevice> aOutDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aOutDev( new VirtualDevice() ); SgfVector aVect; sal_uInt8 nFarb; sal_uInt8 nFrb0=7; diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx index f40afaccf472..88020bedc5fb 100644 --- a/vcl/source/filter/sgvmain.cxx +++ b/vcl/source/filter/sgvmain.cxx @@ -794,7 +794,7 @@ bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) { bool bRet = false; PageType aPage; - ScopedVclPtr<VirtualDevice> aOutDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aOutDev( new VirtualDevice() ); OutputDevice* pOutDev; sal_uLong nStdPos; sal_uLong nCharPos; diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index d3b2ed72b19d..19d4620510aa 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -660,7 +660,7 @@ void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& double, double, UCHAR* cLine, bool TextFit) { - ScopedVclPtr<VirtualDevice> vOut = new VirtualDevice; + ScopedVclPtr<VirtualDevice> vOut( new VirtualDevice() ); UCHAR c,c0; bool First; // first char ? sal_uInt8 Just = 0; // paragraph format diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 4edff5df4ebf..c1b33ce63393 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -498,7 +498,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) LineInfo aLineInfo( LINE_NONE, 0 ); ::std::stack< LineInfo* > aLIStack; - ScopedVclPtr<VirtualDevice> aFontVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aFontVDev( new VirtualDevice() ); rtl_TextEncoding eActualCharSet = osl_getThreadTextEncoding(); bool bFatLine = false; @@ -1374,7 +1374,7 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf ) rtl_TextEncoding eActualCharSet = osl_getThreadTextEncoding(); const Size aPrefSize( rMtf.GetPrefSize() ); bool bRop_0_1 = false; - ScopedVclPtr<VirtualDevice> aSaveVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aSaveVDev( new VirtualDevice() ); Color aLineCol( COL_BLACK ); ::std::stack< Color* > aLineColStack; @@ -2311,7 +2311,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { // write actions for hatch - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); GDIMetaFile aTmpMtf; aVDev->AddHatchActions( rPolyPoly, rHatch, aTmpMtf ); diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index 32b7a839d451..4bb32408706d 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -161,7 +161,7 @@ namespace // in pixel mode for alpha channel painting (black is transparent, // white to paint 100% opacity) const Size aSizePixel(rBitmapEx.GetSizePixel()); - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); aVDev->SetOutputSizePixel(aSizePixel); aVDev->EnableMapMode(false); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 9772a570387d..0720b7f91a29 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -723,7 +723,7 @@ void GDIMetaFile::Move( long nX, long nY ) { const Size aBaseOffset( nX, nY ); Size aOffset( aBaseOffset ); - ScopedVclPtr<VirtualDevice> aMapVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); aMapVDev->EnableOutput( false ); aMapVDev->SetMapMode( GetPrefMapMode() ); @@ -757,7 +757,7 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) { const Size aBaseOffset( nX, nY ); Size aOffset( aBaseOffset ); - ScopedVclPtr<VirtualDevice> aMapVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); aMapVDev->EnableOutput( false ); aMapVDev->SetReferenceDevice( nDPIX, nDPIY ); @@ -825,7 +825,7 @@ void GDIMetaFile::Scale( const Fraction& rScaleX, const Fraction& rScaleY ) void GDIMetaFile::Clip( const Rectangle& i_rClipRect ) { Rectangle aCurRect( i_rClipRect ); - ScopedVclPtr<VirtualDevice> aMapVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); aMapVDev->EnableOutput( false ); aMapVDev->SetMapMode( GetPrefMapMode() ); @@ -892,7 +892,7 @@ void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf, const Gradient& rGrad ) { // Generate comment, GradientEx and Gradient actions (within DrawGradient) - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice( rMapDev, 0 ); + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( rMapDev, 0 ) ); aVDev->EnableOutput( false ); GDIMetaFile aGradMtf; @@ -917,7 +917,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) if( nAngle10 ) { GDIMetaFile aMtf; - ScopedVclPtr<VirtualDevice> aMapVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); const double fAngle = F_PI1800 * nAngle10; const double fSin = sin( fAngle ); const double fCos = cos( fAngle ); @@ -1400,7 +1400,7 @@ static void ImplActionBounds( Rectangle& o_rOutBounds, Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHairline ) const { GDIMetaFile aMtf; - ScopedVclPtr<VirtualDevice> aMapVDev = new VirtualDevice( i_rReference ); + ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice( i_rReference ) ); aMapVDev->EnableOutput( false ); aMapVDev->SetMapMode( GetPrefMapMode() ); @@ -2890,7 +2890,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, long nScaleFlag) const { // initialization seems to be complicated but is used to avoid rounding errors - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); const Point aNullPt; const Point aTLPix( aVDev->LogicToPixel( aNullPt, GetPrefMapMode() ) ); const Point aBRPix( aVDev->LogicToPixel( Point( GetPrefSize().Width() - 1, GetPrefSize().Height() - 1 ), GetPrefMapMode() ) ); diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index e271ae4d5d74..b225280a6102 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -153,7 +153,7 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size void ImplAnimView::drawToPos( sal_uLong nPos ) { - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice; + ScopedVclPtrInstance<VirtualDevice> aVDev; std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL); aVDev->SetOutputSizePixel( maSzPix, false ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index a970919e6dc9..b7d7b3640e22 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -467,7 +467,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) if(maEx.IsEmpty()) { // calculate size - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); Size aDrawSize(aVDev->LogicToPixel(maMetaFile.GetPrefSize(), maMetaFile.GetPrefMapMode())); if(rParameters.getSizePixel().Width() && rParameters.getSizePixel().Height()) diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index a0ac4c32b305..6775985de89a 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -717,7 +717,7 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, if( rMtf.GetActionSize() ) { MapMode aMap( MAP_100TH_MM ); - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() ); const Size aLogSize1( aVDev->PixelToLogic( Size( 1, 1 ), aMap ) ); rMtf.SetPrefMapMode( aMap ); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index c71c52ff2ecb..e7edf4703eaa 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -10938,7 +10938,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject ) sal_Int32 nFunctionObject = createObject(); CHECK_RETURN( updateObject( nFunctionObject ) ); - ScopedVclPtr<VirtualDevice> aDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aDev( new VirtualDevice() ); aDev->SetOutputSizePixel( rObject.m_aSize ); aDev->SetMapMode( MapMode( MAP_PIXEL ) ); if( m_aContext.ColorMode == PDFWriter::DrawGreyscale ) diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 5a556c42e218..2ea36cc68183 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -728,7 +728,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, ConnectedComponents aBackgroundComponent; // create an OutputDevice to record mapmode changes and the like - ScopedVclPtr<VirtualDevice> aMapModeVDev = new VirtualDevice; + ScopedVclPtr<VirtualDevice> aMapModeVDev( new VirtualDevice() ); aMapModeVDev->mnDPIX = mnDPIX; aMapModeVDev->mnDPIY = mnDPIY; aMapModeVDev->EnableOutput(false); @@ -1155,10 +1155,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, Point aDstPtPix( aBoundRect.TopLeft() ); Size aDstSzPix; - ScopedVclPtr<VirtualDevice> aMapVDev = new VirtualDevice; // here, we record only mapmode information + ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); // here, we record only mapmode information aMapVDev->EnableOutput(false); - ScopedVclPtr<VirtualDevice> aPaintVDev = new VirtualDevice; // into this one, we render. + ScopedVclPtr<VirtualDevice> aPaintVDev( new VirtualDevice() ); // into this one, we render. aPaintVDev->SetBackground( aBackgroundComponent.aBgColor ); rOutMtf.AddAction( new MetaPushAction( PushFlags::MAPMODE ) ); diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 711a64a61a94..289fb1b57570 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -410,7 +410,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const // If the visible part has been clipped, we have to create a // Bitmap with the correct size in which we copy the clipped // Bitmap to the correct position. - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice( *this ); + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this ) ); if ( aVDev->SetOutputSizePixel( aRect.GetSize() ) ) { diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 7cff08f96f76..81e8d8cc3b1b 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -431,7 +431,7 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, if( !bDrawn ) { - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice( *this, 1 ); + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this, 1 ) ); const Size aDstSz( aDstRect.GetSize() ); const sal_uInt8 cTrans = (sal_uInt8) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 ); diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx index 87f4314a87cf..5d01f31278e7 100644 --- a/vcl/source/outdev/wallpaper.cxx +++ b/vcl/source/outdev/wallpaper.cxx @@ -129,7 +129,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, { if( !pCached && !rWallpaper.GetColor().GetTransparency() ) { - ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice( *this ); + ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice( *this ) ); aVDev->SetBackground( rWallpaper.GetColor() ); aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) ); aVDev->DrawBitmapEx( Point(), aBmpEx ); |