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/WordComposer.java | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (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 52d13770b..4638c8a8b 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -426,8 +426,9 @@ public final class WordComposer { // Note: currently, we come here whenever we commit a word. If it's a MANUAL_PICK // or a DECIDED_WORD we may cancel the commit later; otherwise, we should deactivate // the last composed word to ensure this does not happen. - final LastComposedWord lastComposedWord = new LastComposedWord( - mTypedWord.toString(), committedWord, separatorString, prevWord, mCapitalizedMode); + final LastComposedWord lastComposedWord = new LastComposedWord(mEvents, + mInputPointers, mTypedWord.toString(), committedWord, separatorString, + prevWord, mCapitalizedMode); mInputPointers.reset(); if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD && type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) { @@ -458,6 +459,24 @@ public final class WordComposer { public void discardPreviousWordForSuggestion() { mPreviousWordForSuggestion = null; } + + public void resumeSuggestionOnLastComposedWord(final LastComposedWord lastComposedWord, + final String previousWord) { + mEvents.clear(); + Collections.copy(mEvents, lastComposedWord.mEvents); + mInputPointers.set(lastComposedWord.mInputPointers); + mTypedWord.setLength(0); + mCombinerChain.reset(); + mTypedWord.append(lastComposedWord.mTypedWord); + refreshSize(); + mCapitalizedMode = lastComposedWord.mCapitalizedMode; + mAutoCorrection = null; // This will be filled by the next call to updateSuggestion. + mCursorPositionWithinWord = mCodePointSize; + mRejectedBatchModeSuggestion = null; + mIsResumed = true; + mPreviousWordForSuggestion = previousWord; + } + public boolean isBatchMode() { return mIsBatchMode; } -- cgit v1.2.3-83-g751a