From 449415c72f437f523a49a9ccfcde8a3c0f583a18 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 26 Jan 2012 19:05:59 +0900 Subject: [PATCH] Cleanup (A9) Deactivate the LastComposedWord when the commit was not the right type, instead of fooling it by passing it a null auto-correction. Change-Id: I032b477dc691bd151a644ca4b0c9f0a9b5512e45 --- java/src/com/android/inputmethod/latin/WordComposer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index b96b0842a..230c2916b 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -311,8 +311,10 @@ public class WordComposer { // instead of only on cancel), and ultimately we want to figure it out even earlier anyway. final LastComposedWord lastComposedWord = new LastComposedWord(mCodes, mXCoordinates, mYCoordinates, mTypedWord.toString(), - (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD) || (null == mAutoCorrection) - ? null : mAutoCorrection.toString()); + null == mAutoCorrection ? null : mAutoCorrection.toString()); + if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD) { + lastComposedWord.deactivate(); + } mCodes.clear(); mTypedWord.setLength(0); mAutoCorrection = null;