sw/source/filter/ww8/docxattributeoutput.cxx | 11 +++-------- sw/source/filter/ww8/docxattributeoutput.hxx | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-)
New commits: commit 26b500afcaed704db7a300836f466517c309ee77 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Mar 13 09:12:11 2015 +0100 DocxAttributeOutput::m_pBackgroundAttrList: use unique_ptr Change-Id: Ide0a7b42fb3f5d679574f9236056ad319972e61f diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ac557f5..99b4fbc 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -860,8 +860,7 @@ void DocxAttributeOutput::WriteCollectedParagraphProperties() if ( m_pBackgroundAttrList ) { - XFastAttributeListRef xAttrList( m_pBackgroundAttrList ); - m_pBackgroundAttrList = NULL; + XFastAttributeListRef xAttrList( m_pBackgroundAttrList.release() ); m_pSerializer->singleElementNS( XML_w, XML_shd, xAttrList ); } @@ -7533,15 +7532,14 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) if( !m_pBackgroundAttrList ) { - m_pBackgroundAttrList = m_pSerializer->createAttrList(); + m_pBackgroundAttrList.reset(m_pSerializer->createAttrList()); m_pBackgroundAttrList->add( FSNS( XML_w, XML_fill ), sColor.getStr() ); m_pBackgroundAttrList->add( FSNS( XML_w, XML_val ), "clear" ); } else if ( sOriginalFill != sColor ) { // fill was modified during edition, theme fill attribute must be dropped - delete m_pBackgroundAttrList; - m_pBackgroundAttrList = m_pSerializer->createAttrList(); + m_pBackgroundAttrList.reset(m_pSerializer->createAttrList()); m_pBackgroundAttrList->add( FSNS( XML_w, XML_fill ), sColor.getStr() ); m_pBackgroundAttrList->add( FSNS( XML_w, XML_val ), "clear" ); } @@ -8280,7 +8278,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_bEndCharSdt(false), m_bStartedCharSdt(false), m_bStartedParaSdt(false), - m_pBackgroundAttrList( NULL ), m_endPageRef( false ), m_pFootnotesList( new ::docx::FootnotesList() ), m_pEndnotesList( new ::docx::FootnotesList() ), @@ -8345,8 +8342,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri DocxAttributeOutput::~DocxAttributeOutput() { - delete m_pBackgroundAttrList, m_pBackgroundAttrList = NULL; - delete m_pFootnotesList, m_pFootnotesList = NULL; delete m_pEndnotesList, m_pEndnotesList = NULL; diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 2311b86..234f357 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -737,7 +737,7 @@ private: /// Attributes of the run color std::unique_ptr<sax_fastparser::FastAttributeList> m_pColorAttrList; /// Attributes of the paragraph background - ::sax_fastparser::FastAttributeList *m_pBackgroundAttrList; + std::unique_ptr<sax_fastparser::FastAttributeList> m_pBackgroundAttrList; OUString m_sOriginalBackgroundColor; OUString m_hyperLinkAnchor; bool m_endPageRef; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits