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

Miklos Vajna vmiklos at collabora.co.uk
Mon Mar 9 01:28:53 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 a4068cb6c65bf16c84769138c6f96585b2e48e56
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Mar 9 09:27:39 2015 +0100

    DocxAttributeOutput::m_pSectionSpacingAttrList: use std::unique_ptr
    
    Change-Id: Ia360b2461d0bf31abc62ae443822259b7197d90d

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0c4bf84..b285a17 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5405,8 +5405,7 @@ void DocxAttributeOutput::EndSection()
     // Write the section properties
     if ( m_pSectionSpacingAttrList )
     {
-        XFastAttributeListRef xAttrList( m_pSectionSpacingAttrList );
-        m_pSectionSpacingAttrList = NULL;
+        XFastAttributeListRef xAttrList( m_pSectionSpacingAttrList.release() );
 
         m_pSerializer->singleElementNS( XML_w, XML_pgMar, xAttrList );
     }
@@ -8282,7 +8281,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
     : m_rExport( rExport ),
       m_pSerializer( pSerializer ),
       m_rDrawingML( *pDrawingML ),
-      m_pSectionSpacingAttrList( NULL ),
       m_pParagraphSpacingAttrList( NULL ),
       m_pHyperlinkAttrList( NULL ),
       m_bEndCharSdt(false),
@@ -8354,7 +8352,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
 
 DocxAttributeOutput::~DocxAttributeOutput()
 {
-    delete m_pSectionSpacingAttrList, m_pSectionSpacingAttrList = NULL;
     delete m_pParagraphSpacingAttrList, m_pParagraphSpacingAttrList = NULL;
     delete m_pHyperlinkAttrList, m_pHyperlinkAttrList = NULL;
     delete m_pColorAttrList, m_pColorAttrList = NULL;
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 2387b3a..1a32632 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -725,7 +725,7 @@ private:
     std::unique_ptr<sax_fastparser::FastAttributeList> m_pFontsAttrList;
     std::unique_ptr<sax_fastparser::FastAttributeList> m_pEastAsianLayoutAttrList;
     std::unique_ptr<sax_fastparser::FastAttributeList> m_pCharLangAttrList;
-    ::sax_fastparser::FastAttributeList *m_pSectionSpacingAttrList;
+    std::unique_ptr<sax_fastparser::FastAttributeList> m_pSectionSpacingAttrList;
     ::sax_fastparser::FastAttributeList *m_pParagraphSpacingAttrList;
     ::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList;
     /// If the current SDT around runs should be ended before the current run.


More information about the Libreoffice-commits mailing list