diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-13 09:12:11 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-13 09:12:46 +0100 |
commit | 26b500afcaed704db7a300836f466517c309ee77 (patch) | |
tree | 4a25cf3ade2c074f4f0accf56b7fb50a7d4c0200 | |
parent | 468677c9f5fbdb91f0817674d1c7765e971e4df1 (diff) |
DocxAttributeOutput::m_pBackgroundAttrList: use unique_ptr
Change-Id: Ide0a7b42fb3f5d679574f9236056ad319972e61f
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ac557f5d079d..99b4fbcb0fc0 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 2311b86b8b9f..234f35726baf 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; |