sw/source/core/doc/DocumentContentOperationsManager.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 2deb30593b382e3780c76dcf9fb4dc8855aefde3 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Tue Jul 28 19:03:24 2020 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Jul 30 21:23:45 2020 +0200 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.st...@cib.de> (cherry picked from commit 8ec8da5638ab465e69900a08067ad496bcb5d3d5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99778 Reviewed-by: Caolán McNamara <caol...@redhat.com> 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits