[Libreoffice-commits] core.git: 2 commits - chart2/source editeng/source filter/source sc/source sdext/source sd/source svtools/source toolkit/source vcl/source

Michael Meeks michael.meeks at collabora.com
Tue May 26 09:48:05 PDT 2015


 chart2/source/controller/dialogs/DataBrowser.cxx |   11 +++++++++--
 editeng/source/editeng/impedit.hxx               |    2 +-
 filter/source/graphicfilter/eos2met/eos2met.cxx  |    2 +-
 filter/source/graphicfilter/idxf/dxf2mtf.cxx     |    2 +-
 filter/source/svg/svgwriter.cxx                  |    2 +-
 sc/source/ui/docshell/sizedev.cxx                |    2 +-
 sc/source/ui/view/gridwin4.cxx                   |    2 +-
 sd/source/filter/eppt/pptx-text.cxx              |    2 +-
 sdext/source/pdfimport/wrapper/wrapper.cxx       |    6 +++---
 svtools/source/control/ctrlbox.cxx               |    2 +-
 toolkit/source/awt/vclxtoolkit.cxx               |    2 +-
 vcl/source/edit/texteng.cxx                      |    2 +-
 vcl/source/edit/textview.cxx                     |    2 +-
 vcl/source/filter/wmf/wmfwr.cxx                  |    2 +-
 vcl/source/gdi/impanmvw.cxx                      |    6 +++---
 15 files changed, 27 insertions(+), 20 deletions(-)

New commits:
commit cc7b8dab7522886f13780950c93033e3369da285
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue May 26 17:53:15 2015 +0100

    tdf#91633 - dispose chart data-table entries correctly.
    
    Change-Id: Ia26df029888f47a0395ea3c8bd7e0e51a1706c2a

diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 1d2eebc..8f0f979 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -144,6 +144,7 @@ class SeriesHeader
 {
 public:
     explicit SeriesHeader(vcl::Window * pParent, vcl::Window *pColorParent);
+            ~SeriesHeader();
 
     void SetColor( const Color & rCol );
     void SetPos( const Point & rPos );
@@ -217,6 +218,13 @@ SeriesHeader::SeriesHeader( vcl::Window * pParent, vcl::Window *pColorParent ) :
     Show();
 }
 
+SeriesHeader::~SeriesHeader()
+{
+    m_spSymbol.disposeAndClear();
+    m_spSeriesName.disposeAndClear();
+    m_spColorBar.disposeAndClear();
+}
+
 void SeriesHeader::notifyChanges()
 {
     if( m_aChangeLink.IsSet())
@@ -417,8 +425,7 @@ bool lcl_SeriesHeaderHasFocus(
     sal_Int32 * pOutIndex = 0 )
 {
     sal_Int32 nIndex = 0;
-    for( ::std::vector< ::boost::shared_ptr< ::chart::impl::SeriesHeader > >::const_iterator aIt( rSeriesHeader.begin());
-         aIt != rSeriesHeader.end(); ++aIt, ++nIndex )
+    for( auto aIt = rSeriesHeader.begin(); aIt != rSeriesHeader.end(); ++aIt, ++nIndex )
     {
         if( (*aIt)->HasFocus())
         {
commit f849d96463d967214bc063f6de912a082272c395
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue May 26 16:02:50 2015 +0100

    tdf#91416 - fix some incorrectly allocated VirtualDevices.
    
    Change-Id: I9ebed313827986473c60e77b7e218b4c1b2487fe

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index c6186b9..4866523 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 abda124..3acff99 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 d02c389..3dd97e2 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 c575deb..986411f 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 744266e..90bca78 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 c175d02..bfda05a 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 cfbf7a6..a890199 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 aa0cf96..4215163 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 99fc5f5..06a4a83 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 9ef383d..5962c95 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 a725932..812b9b5 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 679a983..7f9da0e 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 8e6040f..83b98ce 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 b225280..9d7cea0b 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 );
         }


More information about the Libreoffice-commits mailing list