diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-18 16:57:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-18 21:21:26 +0200 |
commit | c1cd505c67a53a0a27589889b34641612d10946d (patch) | |
tree | 86972cbe4a1e7f0fdad7aafcbc8c81fded1428b4 /sw/source/filter/ww8 | |
parent | 18f202011661397d10ca4c2fa28fcf57b62221b0 (diff) |
ofz#37322 Bad-cast
use a SwUnoCursor for the LastAnchorPos around here, this is similar to
ofz#9858 Bad-cast
Change-Id: I194a39ae13c382740b0ba8145dcc33fb2107105d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120679
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9c0862f5a9c6..09065cc441c3 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2067,8 +2067,17 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr ) pRdr->m_xCtrlStck = std::move(mxOldStck); pRdr->m_xRedlineStack->closeall(*pRdr->m_pPaM->GetPoint()); + + // ofz#37322 drop m_pLastAnchorPos during RedlineStack dtor and restore it afterwards to the same + // place, or somewhere close if that place got destroyed + std::shared_ptr<SwUnoCursor> xLastAnchorCursor(pRdr->m_pLastAnchorPos ? pRdr->m_rDoc.CreateUnoCursor(*pRdr->m_pLastAnchorPos) : nullptr); + pRdr->m_pLastAnchorPos.reset(); + pRdr->m_xRedlineStack = std::move(mxOldRedlines); + if (xLastAnchorCursor) + pRdr->m_pLastAnchorPos.reset(new SwPosition(*xLastAnchorCursor->GetPoint())); + pRdr->DeleteAnchorStack(); pRdr->m_xAnchorStck = std::move(mxOldAnchorStck); |