[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Apr 14 00:42:03 PDT 2015


 sw/source/filter/ww8/docxattributeoutput.cxx |   14 ++++++--------
 sw/source/filter/ww8/docxattributeoutput.hxx |    2 +-
 2 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit ef0340bdafabd51598ad7cf3c647cd35ea09f4e9
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Apr 14 09:40:51 2015 +0200

    DocxAttributeOutput::m_postponedVMLDrawing: use std::unique_ptr<>
    
    Change-Id: I2534601941c6bf838855a378c540771335daf5f9

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index ddf822f..9ebf5eb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1602,8 +1602,8 @@ void DocxAttributeOutput::StartRunProperties()
     OSL_ASSERT( !m_pPostponedDiagrams );
     m_pPostponedDiagrams.reset(new std::list<PostponedDiagram>());
 
-    OSL_ASSERT( m_postponedVMLDrawing == NULL );
-    m_postponedVMLDrawing = new std::list< PostponedDrawing >;
+    OSL_ASSERT( !m_pPostponedVMLDrawings );
+    m_pPostponedVMLDrawings.reset(new std::list<PostponedDrawing>());
 
     assert(!m_postponedDMLDrawing);
     m_postponedDMLDrawing = new std::list< PostponedDrawing >;
@@ -4710,17 +4710,16 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
  */
 void DocxAttributeOutput::WritePostponedVMLDrawing()
 {
-    if(m_postponedVMLDrawing == NULL)
+    if (!m_pPostponedVMLDrawings)
         return;
 
-    for( std::list< PostponedDrawing >::iterator it = m_postponedVMLDrawing->begin();
-         it != m_postponedVMLDrawing->end();
+    for( std::list< PostponedDrawing >::iterator it = m_pPostponedVMLDrawings->begin();
+         it != m_pPostponedVMLDrawings->end();
          ++it )
     {
         m_rExport.SdrExporter().writeVMLDrawing(it->object, *(it->frame), *(it->point));
     }
-    delete m_postponedVMLDrawing;
-    m_postponedVMLDrawing = NULL;
+    m_pPostponedVMLDrawings.reset(0);
 }
 
 void DocxAttributeOutput::WritePostponedCustomShape()
@@ -8282,7 +8281,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
       m_startedHyperlink( false ),
       m_nHyperLinkCount(0),
       m_nFieldsInHyperlink( 0 ),
-      m_postponedVMLDrawing(NULL),
       m_postponedDMLDrawing(NULL),
       m_postponedMath( NULL ),
       m_postponedChart( NULL ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 6005344..093a56b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -848,7 +848,7 @@ private:
         const SwFrmFmt* frame;
         const Point* point;
     };
-    std::list< PostponedDrawing >* m_postponedVMLDrawing;
+    std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedVMLDrawings;
     std::list< PostponedDrawing >* m_postponedDMLDrawing;
     std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedCustomShape;
 


More information about the Libreoffice-commits mailing list