sw/source/filter/ww8/ww8par.cxx | 4 ++-- sw/source/filter/ww8/ww8par.hxx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-)
New commits: commit fe1e7f120581aad3b818e55fc341a1f668b91aae Author: Caolán McNamara <[email protected]> AuthorDate: Sat Sep 25 19:57:36 2021 +0100 Commit: Michael Stahl <[email protected]> CommitDate: Wed Nov 17 19:00:05 2021 +0100 ofz#39252 use safer SwUnoCursor for the pos to move back to Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122611 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit ca844cbdc3e933e3082e9cde0632445916de819e) Change-Id: Iba6f200cea92196986bd30564cf56ab5d8b954b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125386 Tested-by: Michael Stahl <[email protected]> Reviewed-by: Michael Stahl <[email protected]> diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 5d512e2d9d37..c2cf93d00bcb 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1975,7 +1975,7 @@ void SwWW8ImplReader::ImportDopTypography(const WW8DopTypography &rTypo) * Footnotes and Endnotes */ WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) : - maTmpPos(*pRdr->m_pPaM->GetPoint()), + mxTmpPos(pRdr->m_rDoc.CreateUnoCursor(*pRdr->m_pPaM->GetPoint())), mxOldStck(std::move(pRdr->m_xCtrlStck)), mxOldAnchorStck(std::move(pRdr->m_xAnchorStck)), mxOldRedlines(std::move(pRdr->m_xRedlineStack)), @@ -2073,7 +2073,7 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr ) pRdr->DeleteAnchorStack(); pRdr->m_xAnchorStck = std::move(mxOldAnchorStck); - *pRdr->m_pPaM->GetPoint() = maTmpPos; + *pRdr->m_pPaM->GetPoint() = GetStartPos(); if (mxOldPlcxMan != pRdr->m_xPlcxMan) pRdr->m_xPlcxMan = mxOldPlcxMan; diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index a0d500a6eb81..82d861adc0a8 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -46,6 +46,7 @@ #include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <swtypes.hxx> +#include <unocrsr.hxx> #include <fmtfsize.hxx> #include <fmtornt.hxx> #include <fmtsrnd.hxx> @@ -584,7 +585,7 @@ class WW8ReaderSave { private: WW8PLCFxSaveAll maPLCFxSave; - SwPosition maTmpPos; + std::shared_ptr<SwUnoCursor> mxTmpPos; std::deque<bool> maOldApos; std::deque<WW8FieldEntry> maOldFieldStack; std::unique_ptr<SwWW8FltControlStack> mxOldStck; @@ -612,7 +613,7 @@ private: public: WW8ReaderSave(SwWW8ImplReader* pRdr, WW8_CP nStart=-1); void Restore(SwWW8ImplReader* pRdr); - const SwPosition &GetStartPos() const { return maTmpPos; } + const SwPosition &GetStartPos() const { return *mxTmpPos->GetPoint(); } }; enum class eF_ResT { OK, TEXT, TAGIGN, READ_FSPA };
