From 9242a2bcf8a6b07bb045a8356711bed1493c251e Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 3 Feb 2012 10:51:34 +0900 Subject: 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 --- java/src/com/android/inputmethod/latin/WordComposer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java') 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; } -- cgit v1.2.3-83-g751a