diff options
| author | 2010-08-26 15:51:56 -0700 | |
|---|---|---|
| committer | 2010-08-26 15:51:56 -0700 | |
| commit | 511d444be07905b0e45b51a43cc9eed499285c81 (patch) | |
| tree | 19162ae23a59d761624b52456af954d906af0bc9 | |
| parent | 0a84244d92685a0bef4ec2778b95af3705b1ce16 (diff) | |
| parent | b318ef79d5018fdf492ba254438e2d9f1c0fff4c (diff) | |
am b318ef79: am 62dbd82a: Fix for IndexOutOfBounds in TextView getWordLimitsAt.
Merge commit 'b318ef79d5018fdf492ba254438e2d9f1c0fff4c'
* commit 'b318ef79d5018fdf492ba254438e2d9f1c0fff4c':
Fix for IndexOutOfBounds in TextView getWordLimitsAt.
| -rw-r--r-- | core/java/android/widget/TextView.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 92d6158763da..6db5b9c2ff1b 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7113,14 +7113,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); |