Kaydet (Commit) 26b500af authored tarafından Miklos Vajna's avatar Miklos Vajna

DocxAttributeOutput::m_pBackgroundAttrList: use unique_ptr

Change-Id: Ide0a7b42fb3f5d679574f9236056ad319972e61f
üst 468677c9
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment