Merge "Bug 5218421. Spell check crash with Japanese characters"

This commit is contained in:
Gilles Debunne
2011-08-26 13:28:28 -07:00
committed by Android (Google) Code Review

View File

@@ -142,7 +142,7 @@ public class SpellChecker implements SpellCheckerSessionListener {
final int end = editable.getSpanEnd(spellCheckSpan); final int end = editable.getSpanEnd(spellCheckSpan);
// Do not check this word if the user is currently editing it // Do not check this word if the user is currently editing it
if (start >= 0 && end >= 0 && (selectionEnd < start || selectionStart > end)) { if (start >= 0 && end > start && (selectionEnd < start || selectionStart > end)) {
final String word = editable.subSequence(start, end).toString(); final String word = editable.subSequence(start, end).toString();
spellCheckSpan.setSpellCheckInProgress(); spellCheckSpan.setSpellCheckInProgress();
textInfos[textInfosCount++] = new TextInfo(word, mCookie, mIds[i]); textInfos[textInfosCount++] = new TextInfo(word, mCookie, mIds[i]);