Merge "Bug 5385279: IOOB in createMisspelledSuggestionSpan"

This commit is contained in:
Gilles Debunne
2011-10-12 09:51:17 -07:00
committed by Android (Google) Code Review

View File

@@ -239,6 +239,7 @@ public class SpellChecker implements SpellCheckerSessionListener {
SuggestionsInfo suggestionsInfo, SpellCheckSpan spellCheckSpan) { SuggestionsInfo suggestionsInfo, SpellCheckSpan spellCheckSpan) {
final int start = editable.getSpanStart(spellCheckSpan); final int start = editable.getSpanStart(spellCheckSpan);
final int end = editable.getSpanEnd(spellCheckSpan); final int end = editable.getSpanEnd(spellCheckSpan);
if (start < 0 || end < 0) return; // span was removed in the meantime
// Other suggestion spans may exist on that region, with identical suggestions, filter // Other suggestion spans may exist on that region, with identical suggestions, filter
// them out to avoid duplicates. First, filter suggestion spans on that exact region. // them out to avoid duplicates. First, filter suggestion spans on that exact region.