Fix for IndexOutOfBounds in TextView getWordLimitsAt.

Bug http://b/issue?id=2948904

Change-Id: I10008374da92d5a98ec567cc76732383e66c4c5b
This commit is contained in:
Gilles Debunne
2010-08-26 11:09:10 -07:00
parent c6d7a8953d
commit 62dbd82aad

View File

@@ -7047,14 +7047,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);