Skip to content

Commit 1dd7e53

Browse files
author
Gilles Debunne
committed
Bug 5384535: Underline for typo even if there are no suggestions
Change-Id: I63f78227a3a80c5fdb97b1d5d8d6c595a70e1990
1 parent 1c6ac4e commit 1dd7e53

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
@@ -183,18 +183,16 @@ public void onGetSuggestions(SuggestionsInfo[] results) {
183183

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

0 commit comments

Comments
 (0)