Skip to content

Commit 9fb4692

Browse files
Gilles DebunneAndroid (Google) Code Review
authored andcommitted
Merge "Bug 5384535: Underline for typo even if there are no suggestions"
2 parents 5b92a45 + 1dd7e53 commit 9fb4692

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

core/java/android/widget/SpellChecker.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,16 @@ public void onGetSuggestions(SuggestionsInfo[] results) {
185185

186186
if (!isInDictionary && looksLikeTypo) {
187187
String[] suggestions = getSuggestions(suggestionsInfo);
188-
if (suggestions.length > 0) {
189-
SuggestionSpan suggestionSpan = new SuggestionSpan(
190-
mTextView.getContext(), suggestions,
191-
SuggestionSpan.FLAG_EASY_CORRECT |
192-
SuggestionSpan.FLAG_MISSPELLED);
193-
final int start = editable.getSpanStart(spellCheckSpan);
194-
final int end = editable.getSpanEnd(spellCheckSpan);
195-
editable.setSpan(suggestionSpan, start, end,
196-
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
197-
// TODO limit to the word rectangle region
198-
mTextView.invalidate();
199-
}
188+
SuggestionSpan suggestionSpan = new SuggestionSpan(
189+
mTextView.getContext(), suggestions,
190+
SuggestionSpan.FLAG_EASY_CORRECT |
191+
SuggestionSpan.FLAG_MISSPELLED);
192+
final int start = editable.getSpanStart(spellCheckSpan);
193+
final int end = editable.getSpanEnd(spellCheckSpan);
194+
editable.setSpan(suggestionSpan, start, end,
195+
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
196+
// TODO limit to the word rectangle region
197+
mTextView.invalidate();
200198
}
201199
editable.removeSpan(spellCheckSpan);
202200
}

0 commit comments

Comments
 (0)