diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-09-17 19:34:01 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-18 21:59:11 +0200 |
commit | 7a12cd31d5057fb268e6faa47a4c65209a267617 (patch) | |
tree | 6915e5ac3223863672fc8abe9bca9cad7b2e88d6 /cui | |
parent | update credits (diff) | |
download | core-7a12cd31d5057fb268e6faa47a4c65209a267617.tar.gz core-7a12cd31d5057fb268e6faa47a4c65209a267617.zip |
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>
(cherry picked from commit a370107d86c32c1631b00422e2e35ff4b867ce57)
Reviewed-on: https://gerrit.libreoffice.org/79088
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index ea79e61d5177..1bb15c934552 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1561,7 +1561,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; @@ -1600,7 +1600,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(), UNO_QUERY ); |