summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-05-07 17:11:21 +0300
committerMichael Stahl <michael.stahl@allotropia.de>2023-07-17 11:52:17 +0200
commitb1707fea5936557688864124654ef6eeb5c0beb4 (patch)
treea7a8b7f2a92ff7b3215f4b1ba8bd45b9f9902bf5
parentd87c3775acdd0bf9b08444069b51e350a5d91359 (diff)
tdf#137972: when correcting PaMs, move them to the end
The cursor position is pushed in SwView::ExecSpellPopup, and popped in the end, to restore the changed position e.g. when the action is cancelled. In the replacement, the PaM of the pushed cursor is updated in DocumentContentOperationsManager::ReplaceRangeImpl, likely to avoid several updates during the further processing. The stated goal is to move all PaMs out of the deleted range, but the direction is not stated explicitly. If this correction is removed, the cursor PaM gets corrected anyway, and arrives at the end of the replaced text. So, to fix the bug, and to be compliant with the default case, let's correct to the end of the range, instead of the random direction (GetPoint() may return a position at either end, depending how PaM was created). Change-Id: I83bcf01bcc0bf7277a9a34263b524b1212785814 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151462 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 4f93995f2262cde0b16bacc83f4ba3c6161ada7f)
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 315cf5cdeefa..975a35965d17 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4317,7 +4317,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt
// the other views out of the deletion range.
// Except for itself!
SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
- ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() );
+ ::PaMCorrAbs( aDelPam, *aDelPam.End() );
SwPosition *pStt = aDelPam.Start(),
*pEnd = aDelPam.End();