diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-12-06 17:39:56 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-12-07 20:37:10 +0100 |
commit | 04159aab6827e22a67a0c7bc4d68b4a999d51318 (patch) | |
tree | 28ae1058b1218838a97dd8c745f028e63b156b77 /sw/inc/unoframe.hxx | |
parent | ca16def26fa3352edbb642b918b59de1b2fa7fca (diff) |
ofz#18563 sw: remove SwXFrame::m_pCopySource to fix ~SwIndexReg assert
The problem is that a text frame is inserted with a selection that
partially selects a fieldmark, so the DeleteAndJoin() is split across
multiple calls with a temporary cursor, and the correction of the passed
in rPam that is ultimately SwXFrame::m_pCopySource is not done, so it
remains on a deleted node.
Replace it with a SwUnoCursor, which is automatically corrected.
It turns out that this m_pCopySource member was only set via a call to
SetSelection() from one place in SwXText::convertToTextFrame(),
which ends up immediately calling SwXFrame::attach() anyway, which then
uses m_pCopySource and resets it. This was added in
deba85c5b73f36affe672567ed4a45938953f312 but it would be far simpler to
just pass a local variable to SwXFrame::attachToRange().
Change-Id: I85ed128db63c13f81f215d8f50036d9d2aa6c519
Reviewed-on: https://gerrit.libreoffice.org/84661
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/inc/unoframe.hxx')
-rw-r--r-- | sw/inc/unoframe.hxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 074f7b814535..6fcce7a82032 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -71,8 +71,6 @@ private: bool bIsDescriptor; OUString m_sName; - std::unique_ptr<SwPaM> m_pCopySource; - sal_Int64 m_nDrawAspect; sal_Int64 m_nVisibleAreaWidth; sal_Int64 m_nVisibleAreaHeight; @@ -148,7 +146,8 @@ public: /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException - void attachToRange(const css::uno::Reference< css::text::XTextRange > & xTextRange); + void attachToRange(css::uno::Reference<css::text::XTextRange> const& xTextRange, + SwPaM const* pCopySource = nullptr); const SwFrameFormat* GetFrameFormat() const { return m_pFrameFormat; } |