[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - cui/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 29 12:54:01 UTC 2020


 cui/source/dialogs/SpellDialog.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 03b462fb609c57cb098069f19b7076c57710906e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jul 29 11:09:46 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 29 14:53:38 2020 +0200

    tdf#133958 only move the selection to the error if its not already there
    
    Change-Id: I3046c842cc6c8bcc867c79989a8978d382b08269
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99607
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Tested-by: Jenkins

diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 26c3b3bc4098..204a0b308a2e 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1671,8 +1671,17 @@ void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 nStart, sal_Int32 nEnd,
     aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT_CTL));
 
     m_xEditEngine->QuickSetAttribs(aSet, ESelection(0, nStart, 0, nEnd));
-    // so the editview will autoscroll to make this visible
-    m_xEditView->SetSelection(ESelection(0, nStart));
+
+    // Set the selection so the editview will autoscroll to make this visible
+    // unless (tdf#133958) the selection already overlaps this range
+    ESelection aCurrentSelection = m_xEditView->GetSelection();
+    aCurrentSelection.Adjust();
+    bool bCurrentSelectionInRange = nStart <= aCurrentSelection.nEndPos && aCurrentSelection.nStartPos <= nEnd;
+    if (!bCurrentSelectionInRange)
+    {
+        m_xEditView->SetSelection(ESelection(0, nStart));
+    }
+
     Invalidate();
 
     m_nErrorStart = nStart;


More information about the Libreoffice-commits mailing list