am 62dbd82a: Fix for IndexOutOfBounds in TextView getWordLimitsAt.

Merge commit '62dbd82aad0f84c88212566321e3fb370affaf7c' into gingerbread-plus-aosp

* commit '62dbd82aad0f84c88212566321e3fb370affaf7c':
  Fix for IndexOutOfBounds in TextView getWordLimitsAt.
This commit is contained in:
Gilles Debunne
2010-08-26 11:52:44 -07:00
committed by Android Git Automerger

View File

@@ -7052,14 +7052,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return -1;
}
int end = offset;
int len = mText.length();
int end = Math.min(offset, len);
if (end < 0) {
return -1;
}
int start = end;
int len = mText.length();
for (; start > 0; start--) {
char c = mTransformed.charAt(start - 1);