diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-07-28 19:03:24 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-07-29 10:34:15 +0200 |
commit | 8ec8da5638ab465e69900a08067ad496bcb5d3d5 (patch) | |
tree | 8a7b40de2f2c327232dd0aa1f19eb71719a823fe /sw | |
parent | a6859a1fee2f0f3a35cfc381d5ae547eb13fd620 (diff) |
tdf#134250 sw_redlinehide: fix copy non-empty node before non-textnode
The problem in CopyImplImpl() is that pCopyPam's end position was
updated to index 0 but text was copied into the node, which is thus not
covered by pCopyPam and thus also not by SwUndoInserts.
Then SwUndoInserts::UndoImpl() doesn't delete the bookmarks in the end
node and the bookmark positions cause ~SwIndexReg asserts.
Change-Id: I4cc03e846eae4cabd9eb4346a98c1e5c2866050d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99643
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index a8c427678c2d..00a850707be6 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -5064,7 +5064,14 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo if( rPos.nNode != aInsPos ) { pCopyPam->GetMark()->nNode = aInsPos; - pCopyPam->GetMark()->nContent.Assign(pCopyPam->GetContentNode(false), 0); + if (aInsPos < rPos.nNode) + { // tdf#134250 decremented in (pEndTextNd && !pDestTextNd) above + pCopyPam->GetContentNode(false)->MakeEndIndex(&pCopyPam->GetMark()->nContent); + } + else // incremented in (!pSttTextNd && pDestTextNd) above + { + pCopyPam->GetMark()->nContent.Assign(pCopyPam->GetContentNode(false), 0); + } rPos = *pCopyPam->GetMark(); } else |