diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-08-16 12:55:59 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-19 10:18:19 +0200 |
commit | 251b88be7fdca54c38cc7632a85184577f719180 (patch) | |
tree | 85a1d2bee40d58cbca773f48956f744c342be259 /sw/source/core/undo | |
parent | 7f406cbacf9c3abc45c7241535472ffab807e2f0 (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
Diffstat (limited to 'sw/source/core/undo')
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 88fe2c9d1cae..1b14c4ffc8a8 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1211,6 +1211,16 @@ 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.reset( new SwRedlineSaveDatas ); + if (!SwUndo::FillSaveData( aPam, *pRedlSaveData )) + { + pRedlSaveData.reset(); + } + { // move certain indexes out of deleted range SwNodeIndex aSttIdx( aPam.Start()->nNode.GetNode() ); @@ -1219,12 +1229,6 @@ void SwUndoSaveSection::SaveSection( SwDoc::CorrAbs( aSttIdx, aEndIdx, SwPosition( aMvStt ), true ); } - pRedlSaveData.reset( new SwRedlineSaveDatas ); - if( !SwUndo::FillSaveData( aPam, *pRedlSaveData )) - { - pRedlSaveData.reset(); - } - nStartPos = rRange.aStart.GetIndex(); --aPam.GetPoint()->nNode; |