summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-07-28 19:03:24 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-08-03 09:36:02 +0200
commitd4f319edd7ecc9d59cd561e1296e68ee66b1c0bc (patch)
treed59e25508d6a629cc0b41d4833dfc91550e08651
parentbcfea5d6426b22415ea950ff02740d31d82319c2 (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> (cherry picked from commit 8ec8da5638ab465e69900a08067ad496bcb5d3d5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99778 Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2deb30593b382e3780c76dcf9fb4dc8855aefde3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99748 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index f834b8817492..af03431639b2 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -5068,7 +5068,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