summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2011-08-26 10:13:15 -0700
committerGilles Debunne <debunne@google.com>2011-08-26 10:13:18 -0700
commitd6e3494421dff2a091f1011e5266b280b2109843 (patch)
treee69301cdda4078cce24f347da869f9b6b6b15089 /core/java
parent5837dfaf654f1f824d8cc4ef12188d5a27556aa3 (diff)
downloadframeworks_base-d6e3494421dff2a091f1011e5266b280b2109843.zip
frameworks_base-d6e3494421dff2a091f1011e5266b280b2109843.tar.gz
frameworks_base-d6e3494421dff2a091f1011e5266b280b2109843.tar.bz2
Bug 5218421. Spell check crash with Japanese characters
The word iterator returns no word in that case, and this is not supported by TextInfo. Change-Id: Iaf31c58638c02d3cdc7b88bc0d1201e793e84f17
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/widget/SpellChecker.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java
index 5e3b956..ff13dcb 100644
--- a/core/java/android/widget/SpellChecker.java
+++ b/core/java/android/widget/SpellChecker.java
@@ -142,7 +142,7 @@ public class SpellChecker implements SpellCheckerSessionListener {
final int end = editable.getSpanEnd(spellCheckSpan);
// Do not check this word if the user is currently editing it
- if (start >= 0 && end >= 0 && (selectionEnd < start || selectionStart > end)) {
+ if (start >= 0 && end > start && (selectionEnd < start || selectionStart > end)) {
final String word = editable.subSequence(start, end).toString();
spellCheckSpan.setSpellCheckInProgress();
textInfos[textInfosCount++] = new TextInfo(word, mCookie, mIds[i]);