diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-11-18 13:16:54 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-11-18 17:36:04 +0100 |
commit | 83edee3009240a3c26271b8de2450eed3e5acf97 (patch) | |
tree | 0f2f77aff5cdd8057a26c76f58769fcf509805ce | |
parent | 24fd14b387dca458a1b6e9415e936d26562ddb1e (diff) |
tdf#128739 sw: don't delete bookmarks prematurely in SwUndoDelete
::RedoImpl() and SwUndoInserts::UndoImpl().
The bookmarks will be deleted again by DelContentIndex(), which also
adds them to m_pHistory, but RemoveIdxFromRange() deletes them without
adding them to m_pHistory so they won't be restored.
There is some funny commit c50f2e0a69204b8760c2e06313a18b6194f2d109
which is a mystery: if the rPam has to be saved across the
RemoveIdxFromRange() call, then either the rPam that's passed to
RemoveIdxFromRange() is wrong, or the rPam that is restored after the
call is wrong... just revert it and set the same values to rPam.
Change-Id: I9e93ef75bcd2931594aeae07e761c48752d31d9b
Reviewed-on: https://gerrit.libreoffice.org/83084
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r-- | sw/source/core/undo/undel.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/undo/untblk.cxx | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index ebdf25a63978..ab32dff0901c 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -1153,9 +1153,9 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext) if( !m_bDelFullPara ) { - SwUndRng aTmpRng( rPam ); - RemoveIdxFromRange( rPam, false ); - aTmpRng.SetPaM( rPam ); + // tdf#128739 correct cursors but do not delete bookmarks yet + ::PaMCorrAbs(rPam, *rPam.End()); + SetPaM(rPam); if( !m_bJoinNext ) // then restore selection from bottom to top rPam.Exchange(); diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 75d509d43004..0ca015873f88 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -27,6 +27,7 @@ #include <docary.hxx> #include <swundo.hxx> #include <pam.hxx> +#include <mvsave.hxx> #include <ndtxt.hxx> #include <UndoCore.hxx> #include <rolbck.hxx> @@ -238,7 +239,8 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) m_pLastNodeColl = pTextNd->GetTextColl(); } - RemoveIdxFromRange(rPam, false); + // tdf#128739 correct cursors but do not delete bookmarks yet + ::PaMCorrAbs(rPam, *rPam.End()); SetPaM(rPam); } |