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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 15:40:38 UTC 2018


 sw/source/core/undo/undobj.cxx |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 2b3cbeb76247e9819d60d661a4f3546ec731ea80
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Aug 16 12:55:59 2018 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 20 17:40:12 2018 +0200

    sw: fix 0-length delete redlines in SwUndoSaveSection::SaveSection
    
    The delete redlines aren't restored properly on Undo because they are
    squashed into a point by DelBookmarks.
    
    (regression from 6af2caab7271e11d9501fd6a597e05194d33fd10)
    
    Change-Id: I34ea66b5ab0d441c42570e25ea374cb2d0cfc780
    (cherry picked from commit 251b88be7fdca54c38cc7632a85184577f719180)
    Reviewed-on: https://gerrit.libreoffice.org/60745
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 252557ac08b6..f54e297e85ef 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1211,6 +1211,17 @@ void SwUndoSaveSection::SaveSection(
 
     // delete all footnotes, fly frames, bookmarks
     DelContentIndex( *aPam.GetMark(), *aPam.GetPoint() );
+
+    // redlines *before* CorrAbs, because DelBookmarks will make them 0-length
+    // but *after* DelContentIndex because that also may use FillSaveData (in
+    // flys) and that will be restored *after* this one...
+    pRedlSaveData = new SwRedlineSaveDatas;
+    if (!SwUndo::FillSaveData( aPam, *pRedlSaveData ))
+    {
+        delete pRedlSaveData;
+        pRedlSaveData = nullptr;
+    }
+
     {
         // move certain indexes out of deleted range
         SwNodeIndex aSttIdx( aPam.Start()->nNode.GetNode() );
@@ -1219,13 +1230,6 @@ void SwUndoSaveSection::SaveSection(
         SwDoc::CorrAbs( aSttIdx, aEndIdx, SwPosition( aMvStt ), true );
     }
 
-    pRedlSaveData = new SwRedlineSaveDatas;
-    if( !SwUndo::FillSaveData( aPam, *pRedlSaveData ))
-    {
-        delete pRedlSaveData;
-        pRedlSaveData = nullptr;
-    }
-
     nStartPos = rRange.aStart.GetIndex();
 
     --aPam.GetPoint()->nNode;


More information about the Libreoffice-commits mailing list