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.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 7a4a5de2d932b6edfc53b6742029e266c52fa127)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159456
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 1da3444..0a50fbf 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 )
{