diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-12-08 11:25:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-12-08 16:42:27 +0100 |
commit | 8a2bbf1dd54c8efc3e2d969011e5f0bddef07013 (patch) | |
tree | 9c21a8fc37c48f36f0a48d2a4f823b1d20212a40 | |
parent | 26c14088b08c3eff280926ec01f1b24bdbb38705 (diff) |
valgrind: leak with abi2107-1.html
Change-Id: I86d833a26cb50d65e3ec0f46175e9e6da003944b
Reviewed-on: https://gerrit.libreoffice.org/46087
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index b6e1d5db18bf..5a5b028f9ad9 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -434,7 +434,7 @@ class HTMLTable SwHTMLParser *m_pParser; // the current parser HTMLTable *m_pTopTable; // the table on the Top-Level - HTMLTableCnts *m_pParentContents; + std::unique_ptr<HTMLTableCnts> m_xParentContents; HTMLTableContext *m_pContext; // the context of the table @@ -582,8 +582,8 @@ public: void SetHasParentSection( bool bSet ) { m_bHasParentSection = bSet; } bool HasParentSection() const { return m_bHasParentSection; } - void SetParentContents( HTMLTableCnts *pCnts ) { m_pParentContents = pCnts; } - HTMLTableCnts *GetParentContents() const { return m_pParentContents; } + void SetParentContents(HTMLTableCnts *pCnts) { m_xParentContents.reset(pCnts); } + std::unique_ptr<HTMLTableCnts>& GetParentContents() { return m_xParentContents; } void MakeParentContents(); @@ -1027,7 +1027,7 @@ void HTMLTable::InitCtor( const HTMLTableOptions *pOptions ) pOptions->aBGImage, aEmptyOUStr, aEmptyOUStr, aEmptyOUStr ); m_pContext = nullptr; - m_pParentContents = nullptr; + m_xParentContents.reset(); m_aId = pOptions->aId; m_aClass = pOptions->aClass; @@ -3791,15 +3791,14 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, pSubTable->GetTableAdjust(false)!= SvxAdjust::Right, "left or right aligned tables belong in frames" ); - HTMLTableCnts *pParentContents = - pSubTable->GetParentContents(); - if( pParentContents ) + auto& rParentContents = pSubTable->GetParentContents(); + if (rParentContents) { OSL_ENSURE( !pSaveStruct->IsInSection(), "Where is the section" ); // If there's no table coming, we have a section - pSaveStruct->AddContents( pParentContents ); + pSaveStruct->AddContents(rParentContents.release()); } const SwStartNode *pCapStNd = |