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

New commits:
commit 7a12cd31d5057fb268e6faa47a4c65209a267617
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Tue Sep 17 19:34:01 2019 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Sep 18 21:59:11 2019 +0200

    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.st...@cib.de>
    (cherry picked from commit a370107d86c32c1631b00422e2e35ff4b867ce57)
    Reviewed-on: https://gerrit.libreoffice.org/79088
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to