diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-02 21:18:15 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-08-02 17:07:22 +0200 |
commit | 73307219dc530aaa8188c84d044965aee75bccca (patch) | |
tree | 369d9f8138165e5d8cca604f4333574716375795 | |
parent | ofz#9431 don't check attribs of Invalid column (diff) | |
download | core-73307219dc530aaa8188c84d044965aee75bccca.tar.gz core-73307219dc530aaa8188c84d044965aee75bccca.zip |
forcepoint#69 ditch any unclosed m_pPosAfterTOC before dropping cursor
Change-Id: I6b56a48f5449b25fe3bdc2e02d3885388b0da74f
Reviewed-on: https://gerrit.libreoffice.org/58498
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
(cherry picked from commit 71aae473c9c3cf15f75e2722afc7153a3af76d44)
-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 | 9 |
3 files changed, 4 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index f3ab92e7a9a9..b8bc89d44274 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5405,6 +5405,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) SAL_WARN_IF(m_pTableEndPaM, "sw.ww8", "document ended without table ending"); m_pTableEndPaM.reset(); //ensure this is deleted before pPaM + m_pPosAfterTOC.reset(); mpCursor.reset(); m_pPaM = nullptr; m_pLastAnchorPos.reset();//ensure this is deleted before UpdatePageDescs diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 5776dd743ffa..05326eee6aa3 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1358,7 +1358,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 49d0f5eaaa4b..f08c44b66276 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -567,8 +567,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() if (m_pPosAfterTOC) { *m_pPaM = *m_pPosAfterTOC; - delete m_pPosAfterTOC; - m_pPosAfterTOC = nullptr; + m_pPosAfterTOC.reset(); } } } @@ -3394,11 +3393,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; - if (m_pPosAfterTOC) - { - 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); |