Merge "Fix a bug in SpellCheckerService." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-19 23:04:23 +00:00
committed by Android (Google) Code Review

View File

@@ -421,7 +421,8 @@ public abstract class SpellCheckerService extends Service {
final ArrayList<SentenceWordItem> wordItems = new ArrayList<SentenceWordItem>();
wordIterator.setCharSequence(originalText, 0, originalText.length());
int wordEnd = wordIterator.following(start);
int wordStart = wordIterator.getBeginning(wordEnd);
int wordStart = wordEnd == BreakIterator.DONE ? BreakIterator.DONE
: wordIterator.getBeginning(wordEnd);
if (DBG) {
Log.d(TAG, "iterator: break: ---- 1st word start = " + wordStart + ", end = "
+ wordEnd + "\n" + originalText);