Merge "Bug 5327547: re-check word after it (may) have been added to user dictionary."

This commit is contained in:
Gilles Debunne
2011-10-03 12:58:52 -07:00
committed by Android (Google) Code Review

View File

@@ -9986,7 +9986,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
intent.putExtra("word", originalText);
intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
suggestionInfo.removeMisspelledFlag();
// There is no way to know if the word was indeed added. Re-check.
editable.removeSpan(suggestionInfo.suggestionSpan);
updateSpellCheckSpans(spanStart, spanEnd);
} else {
// SuggestionSpans are removed by replace: save them before
SuggestionSpan[] suggestionSpans = editable.getSpans(spanStart, spanEnd,