diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-08-16 12:55:59 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 17:40:12 +0200 |
commit | 2b3cbeb76247e9819d60d661a4f3546ec731ea80 (patch) | |
tree | dc5ffb8e1510e1c00f070ae469f5848cbd0886c5 | |
parent | 760d6f55c847a4ebc9b7780e4443af47cdd1367d (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
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; |