diff options
author | 2012-02-21 23:41:42 -0800 | |
---|---|---|
committer | 2012-02-21 23:41:42 -0800 | |
commit | 1dfdc8056c93a2ea3e26f821af738ce1504af714 (patch) | |
tree | 352c464d1b0b1478c74d19e9c04fd72fc669d681 /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | 8fe892945a898ee2235b8c4367eb42730db4c8d9 (diff) | |
parent | cf9d92629cae88273805eaf7984fcfdd8afd11f5 (diff) | |
download | latinime-1dfdc8056c93a2ea3e26f821af738ce1504af714.tar.gz latinime-1dfdc8056c93a2ea3e26f821af738ce1504af714.tar.xz latinime-1dfdc8056c93a2ea3e26f821af738ce1504af714.zip |
Merge "Give LastComposedWord knowledge of the committed word (A1)"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index a1a329a8d..1f9371538 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -308,9 +308,10 @@ public class WordComposer { } // `type' should be one of the LastComposedWord.COMMIT_TYPE_* constants above. - public LastComposedWord commitWord(final int type) { + public LastComposedWord commitWord(final int type, final String committedWord) { // Note: currently, we come here whenever we commit a word. If it's any *other* kind than - // DECIDED_WORD, we should reset mAutoCorrection so that we don't attempt to cancel later. + // DECIDED_WORD, we should deactivate the last composed word so that we don't attempt to + // cancel later. // If it's a DECIDED_WORD, it may be an actual auto-correction by the IME, or what the user // typed because the IME decided *not* to auto-correct for whatever reason. // Ideally we would also null it when it was a DECIDED_WORD that was not an auto-correct. @@ -326,8 +327,7 @@ public class WordComposer { mXCoordinates = new int[N]; mYCoordinates = new int[N]; final LastComposedWord lastComposedWord = new LastComposedWord(codes, - xCoordinates, yCoordinates, mTypedWord.toString(), - null == mAutoCorrection ? null : mAutoCorrection.toString()); + xCoordinates, yCoordinates, mTypedWord.toString(), committedWord); if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD) { lastComposedWord.deactivate(); } @@ -342,6 +342,6 @@ public class WordComposer { mYCoordinates = lastComposedWord.mYCoordinates; mTypedWord.setLength(0); mTypedWord.append(lastComposedWord.mTypedWord); - mAutoCorrection = lastComposedWord.mAutoCorrection; + mAutoCorrection = null; // This will be filled by the next call to updateSuggestion. } } |