diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-02 21:18:15 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-08-07 17:24:56 +0200 |
commit | 679ab387954b2c8c00a8e9c9b6ad67a65fa432cd (patch) | |
tree | 048e93a8accd549763404571ff3f01bebac15fc7 /sw | |
parent | 5fce37bd1dbd6135e5e51356da6acd8326717ab3 (diff) |
forcepoint#69 ditch any unclosed m_pPosAfterTOC before dropping cursor
Change-Id: I6b56a48f5449b25fe3bdc2e02d3885388b0da74f
Reviewed-on: https://gerrit.libreoffice.org/58497
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 6 |
3 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index c9b994a76f94..236b4a578443 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5385,6 +5385,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) m_xLstManager.reset(); } + m_pPosAfterTOC.reset(); mpCursor.reset(); m_pPaM = nullptr; diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 37d74e6c0d26..a3f8bb6a5745 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1354,7 +1354,7 @@ private: // Indicate that current on loading a hyperlink, which is inside a TOC; Managed by Read_F_Hyperlink() and End_Field() bool m_bLoadingTOXHyperlink; // a document position recorded the after-position of TOC section, managed by Read_F_TOX() and End_Field() - SwPaM* m_pPosAfterTOC; + std::unique_ptr<SwPaM> m_pPosAfterTOC; // used for some dropcap tweaking SwTextNode* m_pPreviousNode; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 978c9f877e3e..efd87ee64a05 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -569,8 +569,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() if (m_pPosAfterTOC) { *m_pPaM = *m_pPosAfterTOC; - delete m_pPosAfterTOC; - m_pPosAfterTOC = nullptr; + m_pPosAfterTOC.reset(); } } } @@ -3410,8 +3409,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) //The TOC field representation contents should be inserted into TOC section, but not after TOC section. //So we need update the document position when loading TOC representation and after loading TOC; - delete m_pPosAfterTOC; - m_pPosAfterTOC = new SwPaM(*m_pPaM, m_pPaM); + m_pPosAfterTOC.reset(new SwPaM(*m_pPaM, m_pPaM)); (*m_pPaM).Move(fnMoveBackward); SwPaM aRegion(*m_pPaM, m_pPaM); |