From 26baa759d88a03b5ff01cafab5de10e6fa9f848f Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 27 Mar 2014 09:43:21 +0000 Subject: Revert "[CB16] Remove unused stuff" This reverts commit 05c46f59fdc6065aad833d905fc9759ba907fc82. Change-Id: Ica0feea10fff1b2a9ef42bc55cb7c1892b3a3f58 --- .../android/inputmethod/latin/LastComposedWord.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/LastComposedWord.java') diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java index 69963d222..a3b030626 100644 --- a/java/src/com/android/inputmethod/latin/LastComposedWord.java +++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java @@ -38,25 +38,38 @@ public final class LastComposedWord { // or it may be exactly what the user typed if it's in the dictionary or the IME does not have // enough confidence in any suggestion to auto-correct (auto-correct to typed word). public static final int COMMIT_TYPE_DECIDED_WORD = 2; + // COMMIT_TYPE_CANCEL_AUTO_CORRECT is used upon committing back the old word upon cancelling + // an auto-correction. + public static final int COMMIT_TYPE_CANCEL_AUTO_CORRECT = 3; public static final String NOT_A_SEPARATOR = ""; + public final ArrayList mEvents; public final String mTypedWord; public final CharSequence mCommittedWord; public final String mSeparatorString; public final String mPrevWord; public final int mCapitalizedMode; + public final InputPointers mInputPointers = + new InputPointers(Constants.DICTIONARY_MAX_WORD_LENGTH); private boolean mActive; public static final LastComposedWord NOT_A_COMPOSED_WORD = - new LastComposedWord("", "", NOT_A_SEPARATOR, null, WordComposer.CAPS_MODE_OFF); + new LastComposedWord(new ArrayList(), null, "", "", + NOT_A_SEPARATOR, null, WordComposer.CAPS_MODE_OFF); // Warning: this is using the passed objects as is and fully expects them to be // immutable. Do not fiddle with their contents after you passed them to this constructor. - public LastComposedWord(final String typedWord, final CharSequence committedWord, - final String separatorString, final String prevWord, final int capitalizedMode) { + public LastComposedWord(final ArrayList events, + final InputPointers inputPointers, final String typedWord, + final CharSequence committedWord, final String separatorString, + final String prevWord, final int capitalizedMode) { + if (inputPointers != null) { + mInputPointers.copy(inputPointers); + } mTypedWord = typedWord; + mEvents = new ArrayList(events); mCommittedWord = committedWord; mSeparatorString = separatorString; mActive = true; -- cgit v1.2.3-83-g751a