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

DocxAttribouteOutput::m_pHyperlinkAttrList: use unique_ptr

Change-Id: I7da23e7b7d35f2cf46c7dfbc8f251da2205925bb
üst 8e8a97fe
......@@ -1119,10 +1119,9 @@ void DocxAttributeOutput::EndRun()
// Start the hyperlink after the fields separators or we would generate invalid file
if ( m_pHyperlinkAttrList )
{
XFastAttributeListRef xAttrList ( m_pHyperlinkAttrList );
XFastAttributeListRef xAttrList ( m_pHyperlinkAttrList.release() );
m_pSerializer->startElementNS( XML_w, XML_hyperlink, xAttrList );
m_pHyperlinkAttrList = NULL;
m_startedHyperlink = true;
m_nHyperLinkCount++;
}
......@@ -2221,7 +2220,7 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge
else
{
// Output a hyperlink XML element
m_pHyperlinkAttrList = m_pSerializer->createAttrList();
m_pHyperlinkAttrList.reset(m_pSerializer->createAttrList());
if ( !bBookmarkOnly )
{
......@@ -8279,7 +8278,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
: m_rExport( rExport ),
m_pSerializer( pSerializer ),
m_rDrawingML( *pDrawingML ),
m_pHyperlinkAttrList( NULL ),
m_bEndCharSdt(false),
m_bStartedCharSdt(false),
m_bStartedParaSdt(false),
......@@ -8349,7 +8347,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
DocxAttributeOutput::~DocxAttributeOutput()
{
delete m_pHyperlinkAttrList, m_pHyperlinkAttrList = NULL;
delete m_pColorAttrList, m_pColorAttrList = NULL;
delete m_pBackgroundAttrList, m_pBackgroundAttrList = NULL;
......
......@@ -727,7 +727,7 @@ private:
std::unique_ptr<sax_fastparser::FastAttributeList> m_pCharLangAttrList;
std::unique_ptr<sax_fastparser::FastAttributeList> m_pSectionSpacingAttrList;
std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSpacingAttrList;
::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList;
std::unique_ptr<sax_fastparser::FastAttributeList> m_pHyperlinkAttrList;
/// If the current SDT around runs should be ended before the current run.
bool m_bEndCharSdt;
/// If an SDT around runs is currently open.
......
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