summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-05-01 00:34:22 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-05-01 00:36:48 +0200
commitf1b2261cef7c9996af60f8902e9c0db4bbf896ac (patch)
tree9e07685050b2184fb9bb77dd2cbdfb574e4bf746
parent2dda1cd4d1927790d546dbaf1893279d18515bae (diff)
break infinite loop
endOfScript() can return -1 , which will never be >= maText.getLength(), and nothing will update once nChg is that way. It originally worked when nChg was unsigned, but 44fbecbfe297cefcc844ca2071fbf017777dd4c3 changed that and missed it (no wonder, given even the explicit cast, which was stupid, so possibly there is a problem elsewhere, but this way it at least doesn't lock up). Change-Id: Ia5138ba36916bd0bfb8f07854580c39d2622f201
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 2b83a8313c3c..5edfda138434 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -428,7 +428,7 @@ void SwDropCapsPict::CheckScript( void )
{
nChg = xBreak->endOfScript( maText, nChg, nScript );
maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) );
- if( nChg >= maText.getLength() )
+ if( nChg >= maText.getLength() || nChg < 0 )
break;
nScript = xBreak->getScriptType( maText, nChg );
}