diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-10-18 14:03:03 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-10-23 13:07:23 +0200 |
commit | 26599f049df7c52eca001ba52a0684888201e1ba (patch) | |
tree | 51c4823b79535b87c4e9c0473d53973a566a7e4f | |
parent | 35b93ab6be79e5506248aea2f5b618db54e93c0f (diff) |
sw: fix crash after SwXFieldmark::SetFieldType()
It deletes the existing IFieldmark and creates a new one; meanwhile the
SwXFieldmark is disposed and its m_pImpl->m_pDoc is cleared but then
it's not initialised again by registerInMark().
(regression from f66a83c95c21b4311918a64bb85016857b49f4d4)
Change-Id: I8c4d9b829f68b9e5bd714bcad2061d0ff95bfb82
Reviewed-on: https://gerrit.libreoffice.org/81081
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r-- | sw/source/core/unocore/unobkm.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 28af288deef4..ddeaccf1966b 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -104,6 +104,8 @@ void SwXBookmark::Impl::registerInMark(SwXBookmark& rThis, { pMarkBase->SetXBookmark(xBookmark); } + assert(m_pDoc == nullptr || m_pDoc == pBkmk->GetMarkPos().GetDoc()); + m_pDoc = pBkmk->GetMarkPos().GetDoc(); } else if (m_pRegisteredBookmark) { |