summaryrefslogtreecommitdiff
path: root/filter/source/graphicfilter/eps/eps.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'filter/source/graphicfilter/eps/eps.cxx')
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx42
1 files changed, 21 insertions, 21 deletions
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" );