cui/source/dialogs/SpellDialog.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5deeb28a32146b0de887a4eb6fb3e23cb2f4549b
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Wed Nov 15 16:49:58 2023 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sat Nov 18 10:04:38 2023 +0100

    tdf#157992 update error position after modifying input
    
    a manual fix in the text changes the start/end position of the error
    that needs to be updateed to find the correct error text when applying the 
change
    
    Change-Id: I91b0801d5a08ee9e2508493cce03b8112c48a542
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159449
    Tested-by: Jenkins
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit 7a4a5de2d932b6edfc53b6742029e266c52fa127)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159456
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 1da34447f779..0a50fbfb8cd7 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1504,6 +1504,8 @@ bool SentenceEditWindow_Impl::KeyInput(const KeyEvent& 
rKeyEvt)
         //start position
         if (!IsUndoEditMode() && bIsErrorActive)
         {
+            aAttribList.clear();
+            m_xEditEngine->GetCharAttribs(0, aAttribList);
             const EECharAttrib* pFontColor = FindCharAttrib(nCursor, 
EE_CHAR_COLOR, aAttribList);
             const EECharAttrib* pErrorAttrib = FindCharAttrib(m_nErrorStart, 
EE_CHAR_GRABBAG, aAttribList);
             if (pFontColor && pErrorAttrib)
@@ -1968,7 +1970,6 @@ svx::SpellPortions 
SentenceEditWindow_Impl::CreateSpellPortions() const
                 aPortion1.eLanguage = eLang;
 
                 aPortion1.sText = m_xEditEngine->GetText(ESelection(0, nStart, 
0, aStart->nPosition));
-
                 bool bIsIgnoreError = m_aIgnoreErrorsAt.find( nStart ) != 
m_aIgnoreErrorsAt.end();
                 if( bIsIgnoreError )
                 {

Reply via email to