aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/RichInputConnection.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-12-14 10:59:21 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-14 10:59:21 -0800
commitdb6f21c6792fe07a733572e1d4978f46b5462c35 (patch)
tree3a2d0c289e0ead79c8df7d582fa043bc8f975f0c /java/src/com/android/inputmethod/latin/RichInputConnection.java
parent81b0a638520baeca52738ade215190d2caef6345 (diff)
parent18d688c94bb8e1e26de2d12445cb3096c6126f75 (diff)
downloadlatinime-db6f21c6792fe07a733572e1d4978f46b5462c35.tar.gz
latinime-db6f21c6792fe07a733572e1d4978f46b5462c35.tar.xz
latinime-db6f21c6792fe07a733572e1d4978f46b5462c35.zip
am 18d688c9: Use the amended user dictionary word for insertion
* commit '18d688c94bb8e1e26de2d12445cb3096c6126f75': Use the amended user dictionary word for insertion
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java')
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index 75b67bfc6..3b732278b 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -339,6 +339,24 @@ public final class RichInputConnection {
}
}
+ public void setComposingRegion(final int start, final int end) {
+ if (DEBUG_BATCH_NESTING) checkBatchEdit();
+ if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
+ mCurrentCursorPosition = end;
+ final CharSequence textBeforeCursor =
+ getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE + (end - start), 0);
+ final int indexOfStartOfComposingText =
+ Math.max(textBeforeCursor.length() - (end - start), 0);
+ mComposingText.append(textBeforeCursor.subSequence(indexOfStartOfComposingText,
+ textBeforeCursor.length()));
+ mCommittedTextBeforeComposingText.setLength(0);
+ mCommittedTextBeforeComposingText.append(
+ textBeforeCursor.subSequence(0, indexOfStartOfComposingText));
+ if (null != mIC) {
+ mIC.setComposingRegion(start, end);
+ }
+ }
+
public void setComposingText(final CharSequence text, final int i) {
if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();