diff options
author | 2012-02-03 10:51:34 +0900 | |
---|---|---|
committer | 2012-02-03 11:15:46 +0900 | |
commit | 9242a2bcf8a6b07bb045a8356711bed1493c251e (patch) | |
tree | 9c7cebb930034ce21b7402f2fda3df8ddb7bd797 /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | fbd83a87123494a9a02364fa6688734155728256 (diff) | |
download | latinime-9242a2bcf8a6b07bb045a8356711bed1493c251e.tar.gz latinime-9242a2bcf8a6b07bb045a8356711bed1493c251e.tar.xz latinime-9242a2bcf8a6b07bb045a8356711bed1493c251e.zip |
Fix string iterations in a couple places.
Seems I didn't get how to iterate on a String correctly >.>
Talk about a big bug. Anyway, I think it's working now.
Bug: 5955228
Change-Id: I988c900cf2a16c44b9505cfd4f77c7cda7e592f0
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index bd244b913..fa1b5ef6c 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -221,7 +221,8 @@ public class WordComposer { if (mTrailingSingleQuotesCount > 0) { --mTrailingSingleQuotesCount; } else { - for (int i = mTypedWord.length() - 1; i >= 0; --i) { + for (int i = mTypedWord.offsetByCodePoints(mTypedWord.length(), -1); + i >= 0; i = mTypedWord.offsetByCodePoints(i, -1)) { if (Keyboard.CODE_SINGLE_QUOTE != mTypedWord.codePointAt(i)) break; ++mTrailingSingleQuotesCount; } |