[Libreoffice-commits] core.git: Branch 'libreoffice-6-4-6' - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 3 07:36:37 UTC 2020


 sw/source/core/doc/DocumentContentOperationsManager.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit d4f319edd7ecc9d59cd561e1296e68ee66b1c0bc
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jul 28 19:03:24 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Aug 3 09:36:02 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.stahl at cib.de>
    (cherry picked from commit 8ec8da5638ab465e69900a08067ad496bcb5d3d5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99778
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 2deb30593b382e3780c76dcf9fb4dc8855aefde3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99748
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Miklos Vajna <vmiklos at collabora.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


More information about the Libreoffice-commits mailing list