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/source/gdi | |
parent | 8fb4672aef888fc5a582ca9508799ecdbe777c42 (diff) |
cure a lot of unfortunate ScopedVclPtrs.
Change-Id: I2149511f958ba75e81dc41b10b01eb9d19610037
Diffstat (limited to 'vcl/source/gdi')
-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 |
8 files changed, 18 insertions, 18 deletions
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 ) ); |