summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-09-17 19:34:01 +0200
committerMichael Stahl <michael.stahl@cib.de>2019-09-18 13:56:47 +0200
commita370107d86c32c1631b00422e2e35ff4b867ce57 (patch)
tree14448c4d9da0dff81395d793088aed2e66cd6be7 /cui
parent77fc63f39c7990ccd3f152ad9311656b58f718a2 (diff)
cui: infinite loop in SentenceEditWindow_Impl::MarkNextError()
Looks like previously the aCursor never moved backwards so try to ensure the same for nCursor. (regression from 5261417cbb3051b812164838d19c0f748573df45) Change-Id: I7d2f04bbc6d1274ec4feff57927494f2eb5d665c Reviewed-on: https://gerrit.libreoffice.org/79071 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/SpellDialog.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index ab03a51c4e15..d5043281cfac 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1530,7 +1530,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css
//create a cursor behind the end of the last error
//- or at 0 at the start of the sentence
- int nCursor(m_nErrorEnd ? m_nErrorEnd + 1 : 0);
+ sal_Int32 nCursor(m_nErrorEnd ? m_nErrorEnd + 1 : 0);
//search for SpellErrorDescription
SpellErrorDescription aSpellErrorDescription;
@@ -1569,7 +1569,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css
pSpellErrorDescription = &aSpellErrorDescription;
}
- nCursor = nMinPos;
+ nCursor = std::max(nCursor, nMinPos); // move forward if possible
// maybe the error found here is already in the ChangeAllList and has to be replaced
Reference<XDictionary> xChangeAll = LinguMgr::GetChangeAllList();