diff options
author | Amith Yamasani <yamasani@google.com> | 2010-09-23 11:34:11 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-23 11:34:11 -0700 |
commit | 847810f0cdccd10e6e233281d4eb984b7ce8d680 (patch) | |
tree | 423c50d84466ed1b7cd1ee6881e91084d3e8ccd2 /core | |
parent | 999d483bf8fc4271c42484aaf253f12e4eb8ff29 (diff) | |
parent | 6e98c280f792932d60bf9374c8979d9eadce2d9c (diff) | |
download | frameworks_base-847810f0cdccd10e6e233281d4eb984b7ce8d680.zip frameworks_base-847810f0cdccd10e6e233281d4eb984b7ce8d680.tar.gz frameworks_base-847810f0cdccd10e6e233281d4eb984b7ce8d680.tar.bz2 |
am 6e98c280: Merge "Fix for IndexOutOfBounds in setComposingRegion." into gingerbread
Merge commit '6e98c280f792932d60bf9374c8979d9eadce2d9c' into gingerbread-plus-aosp
* commit '6e98c280f792932d60bf9374c8979d9eadce2d9c':
Fix for IndexOutOfBounds in setComposingRegion.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/inputmethod/BaseInputConnection.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java index 3801948..f7c869b 100644 --- a/core/java/android/view/inputmethod/BaseInputConnection.java +++ b/core/java/android/view/inputmethod/BaseInputConnection.java @@ -428,8 +428,12 @@ public class BaseInputConnection implements InputConnection { a = b; b = tmp; } + // Clip the end points to be within the content bounds. + final int length = content.length(); if (a < 0) a = 0; - if (b > content.length()) b = content.length(); + if (b < 0) b = 0; + if (a > length) a = length; + if (b > length) b = length; ensureDefaultComposingSpans(); if (mDefaultComposingSpans != null) { |