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

Miklos Vajna vmiklos at collabora.co.uk
Thu Mar 12 01:19:04 PDT 2015


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

New commits:
commit c2f99275eb391c7e2aa72b51e68db9f0e4d8e96c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Mar 12 09:18:00 2015 +0100

    DocxAttributeOutput::m_pColorAttrList: use shared_ptr
    
    Change-Id: I48083b6f984ade7ad574e1f51922e249fd08a96c

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index dae6e0b..ac557f5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1883,8 +1883,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
 
     if ( m_pColorAttrList )
     {
-        XFastAttributeListRef xAttrList( m_pColorAttrList );
-        m_pColorAttrList = NULL;
+        XFastAttributeListRef xAttrList( m_pColorAttrList.release() );
 
         m_pSerializer->singleElementNS( XML_w, XML_color, xAttrList );
     }
@@ -8281,7 +8280,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
       m_bEndCharSdt(false),
       m_bStartedCharSdt(false),
       m_bStartedParaSdt(false),
-      m_pColorAttrList( NULL ),
       m_pBackgroundAttrList( NULL ),
       m_endPageRef( false ),
       m_pFootnotesList( new ::docx::FootnotesList() ),
@@ -8347,7 +8345,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
 
 DocxAttributeOutput::~DocxAttributeOutput()
 {
-    delete m_pColorAttrList, m_pColorAttrList = NULL;
     delete m_pBackgroundAttrList, m_pBackgroundAttrList = NULL;
 
     delete m_pFootnotesList, m_pFootnotesList = NULL;
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index a4fcf4d..2311b86 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -735,7 +735,7 @@ private:
     /// If an SDT around paragraphs is currently open.
     bool m_bStartedParaSdt;
     /// Attributes of the run color
-    ::sax_fastparser::FastAttributeList *m_pColorAttrList;
+    std::unique_ptr<sax_fastparser::FastAttributeList> m_pColorAttrList;
     /// Attributes of the paragraph background
     ::sax_fastparser::FastAttributeList *m_pBackgroundAttrList;
     OUString m_sOriginalBackgroundColor;


More information about the Libreoffice-commits mailing list