summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-05-26 16:02:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-05-27 13:58:23 +0100
commitf34c1e9ba7d831c42c89d3c59d501ce6cc858dbe (patch)
tree76ba9cd6bd24d988f8e9c4bc6f2c531b6d1f6386
parent3a34f96a16ad3063302670a57a1ed508302e3ffb (diff)
tdf#91416 - fix some incorrectly allocated VirtualDevices.
Change-Id: I9ebed313827986473c60e77b7e218b4c1b2487fe (cherry picked from commit f849d96463d967214bc063f6de912a082272c395)
-rw-r--r--editeng/source/editeng/impedit.hxx2
-rw-r--r--filter/source/graphicfilter/eos2met/eos2met.cxx2
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.cxx2
-rw-r--r--filter/source/svg/svgwriter.cxx2
-rw-r--r--sc/source/ui/docshell/sizedev.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-text.cxx2
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx6
-rw-r--r--svtools/source/control/ctrlbox.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx2
-rw-r--r--vcl/source/edit/texteng.cxx2
-rw-r--r--vcl/source/edit/textview.cxx2
-rw-r--r--vcl/source/filter/wmf/wmfwr.cxx2
-rw-r--r--vcl/source/gdi/impanmvw.cxx6
14 files changed, 18 insertions, 18 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 93f2b8ff2f95..d08ee75faa26 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -1069,7 +1069,7 @@ inline EditSelection ImpEditEngine::CreateSel( const ESelection& rSel )
inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode& rMapMode, DrawModeFlags nDrawMode )
{
if ( !pVirtDev )
- pVirtDev = new VirtualDevice;
+ pVirtDev = VclPtr<VirtualDevice>::Create();
if ( ( pVirtDev->GetMapMode().GetMapUnit() != rMapMode.GetMapUnit() ) ||
( pVirtDev->GetMapMode().GetScaleX() != rMapMode.GetScaleX() ) ||
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index abda124e92fb..3acff99057c5 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -262,7 +262,7 @@ public:
if( !pCompDev )
{
apDummyVDev.disposeAndClear();
- apDummyVDev.reset( new VirtualDevice );
+ apDummyVDev.reset( VclPtr<VirtualDevice>::Create() );
pCompDev = apDummyVDev.get();
}
}
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index d02c38913b27..3dd97e2cd1b5 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -776,7 +776,7 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
const DXFLayer * pLayer;
const DXFVPort * pVPort;
- pVirDev = new VirtualDevice;
+ pVirDev = VclPtr<VirtualDevice>::Create();
pDXF = &rDXF;
bStatus = true;
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 16f3fc948431..56c5f76199e3 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1652,7 +1652,7 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport
mbClipAttrChanged( false ),
mbIsPlaceholderShape( false )
{
- mpVDev = new VirtualDevice;
+ mpVDev = VclPtr<VirtualDevice>::Create();
mpVDev->EnableOutput( false );
maTargetMapMode = MAP_100TH_MM;
maTextWriter.setVirtualDevice( mpVDev, maTargetMapMode );
diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx
index 744266efe4f5..90bca78f619f 100644
--- a/sc/source/ui/docshell/sizedev.cxx
+++ b/sc/source/ui/docshell/sizedev.cxx
@@ -39,7 +39,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
}
else
{
- pDevice = new VirtualDevice;
+ pDevice = VclPtr<VirtualDevice>::Create();
pDevice->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
bOwner = true;
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index c175d022a0a0..bfda05af7464 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -498,7 +498,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
// #i45033# For OLE inplace editing with different zoom factors,
// use a virtual device with 1/100th mm as text formatting reference
- xFmtVirtDev.reset( new VirtualDevice );
+ xFmtVirtDev.reset( VclPtr<VirtualDevice>::Create() );
xFmtVirtDev->SetMapMode( MAP_100TH_MM );
aOutputData.SetFmtDevice( xFmtVirtDev.get() );
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index cfbf7a6f61e3..a89019901a14 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -1432,7 +1432,7 @@ sal_uInt32 FontCollection::GetId( FontCollectionEntry& rEntry )
aFont.SetHeight( 100 );
if ( !pVDev )
- pVDev = new VirtualDevice;
+ pVDev = VclPtr<VirtualDevice>::Create();
pVDev->SetFont( aFont );
FontMetric aMetric( pVDev->GetFontMetric() );
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index aa0cf96a448b..4215163697e8 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -660,9 +660,9 @@ void Parser::readFont()
}
- static VirtualDevice* vDev = 0;
- if (vDev == 0)
- vDev = new VirtualDevice;
+ static VclPtr<VirtualDevice> vDev;
+ if (!vDev)
+ vDev = VclPtr<VirtualDevice>::Create();
vcl::Font font(aResult.familyName, Size(0, 1000));
vDev->SetFont(font);
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 9b7bb5955e69..5414eaf37dc1 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -725,7 +725,7 @@ LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) :
ListBox( pParent, nWinStyle ),
m_nWidth( 5 ),
m_sNone( ),
- aVirDev( new VirtualDevice ),
+ aVirDev( VclPtr<VirtualDevice>::Create() ),
aColor( COL_BLACK ),
maPaintCol( COL_BLACK )
{
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 9ef383ddf35b..5962c95a5647 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -731,7 +731,7 @@ void SAL_CALL VCLXToolkit::disposing()
SolarMutexGuard aSolarGuard;
- VirtualDevice* pV = new VirtualDevice;
+ VclPtrInstance<VirtualDevice> pV;
pV->SetOutputSizePixel( Size( Width, Height ) );
pVDev->SetVirtualDevice( pV );
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index a7259326762c..812b9b5e29f9 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -93,7 +93,7 @@ TextEngine::TextEngine()
mpIdleFormatter = new IdleFormatter;
mpIdleFormatter->SetIdleHdl( LINK( this, TextEngine, IdleFormatHdl ) );
- mpRefDev = new VirtualDevice;
+ mpRefDev = VclPtr<VirtualDevice>::Create();
ImpInitLayoutMode( mpRefDev );
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index 691fba86b2ac..0720fd4c9cb8 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -529,7 +529,7 @@ VirtualDevice* TextView::GetVirtualDevice()
{
if ( !mpImpl->mpVirtDev )
{
- mpImpl->mpVirtDev = new VirtualDevice;
+ mpImpl->mpVirtDev = VclPtr<VirtualDevice>::Create();
mpImpl->mpVirtDev->SetLineColor();
}
return mpImpl->mpVirtDev;
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index 8e6040fc23ac..83b98ce7f454 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -1710,7 +1710,7 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
bEmbedEMF = true;
bStatus=true;
- pVirDev = new VirtualDevice;
+ pVirDev = VclPtr<VirtualDevice>::Create();
if (pFConfigItem)
{
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index b225280a6102..9d7cea0b529a 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -33,8 +33,8 @@ ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
maSz ( rSz ),
maSzPix ( mpOut->LogicToPixel( maSz ) ),
maClip ( mpOut->GetClipRegion() ),
- mpBackground ( new VirtualDevice ),
- mpRestore ( new VirtualDevice ),
+ mpBackground ( VclPtr<VirtualDevice>::Create() ),
+ mpRestore ( VclPtr<VirtualDevice>::Create() ),
meLastDisposal ( DISPOSE_BACK ),
mbPause ( false ),
mbMarked ( false ),
@@ -217,7 +217,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
// get output device
if( !pVDev )
{
- pDev = new VirtualDevice;
+ pDev = VclPtr<VirtualDevice>::Create();
pDev->SetOutputSizePixel( maSzPix, false );
pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
}