am 5bde3a61: Fix an old bug in getting a word from the connected view.

* commit '5bde3a61633556afb16481680daefc7cabbf5890':
  Fix an old bug in getting a word from the connected view.
This commit is contained in:
Jean Chalard 2012-12-26 22:52:03 -08:00 committed by Android Git Automerger
commit 0da5d0d600

View file

@ -568,14 +568,9 @@ public final class RichInputConnection {
} }
} }
final int cursor = getCursorPosition(); final String word = before.toString().substring(start, before.length())
if (start >= 0 && cursor + end <= after.length() + before.length()) { + after.toString().substring(0, end);
String word = before.toString().substring(start, before.length()) return new Range(before.length() - start, end, word);
+ after.toString().substring(0, end);
return new Range(before.length() - start, end, word);
}
return null;
} }
public boolean isCursorTouchingWord(final SettingsValues settingsValues) { public boolean isCursorTouchingWord(final SettingsValues settingsValues) {