diff options
author | 2012-02-21 23:11:07 -0800 | |
---|---|---|
committer | 2012-02-21 23:12:21 -0800 | |
commit | cf9d92629cae88273805eaf7984fcfdd8afd11f5 (patch) | |
tree | 0e42974e0a16159e64ef5ae51af36656a43415ee /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | c6993e4947d0d2c5ac673fbaa99c816b69043074 (diff) | |
download | latinime-cf9d92629cae88273805eaf7984fcfdd8afd11f5.tar.gz latinime-cf9d92629cae88273805eaf7984fcfdd8afd11f5.tar.xz latinime-cf9d92629cae88273805eaf7984fcfdd8afd11f5.zip |
Give LastComposedWord knowledge of the committed word (A1)
There is no point storing the prospective autocorrect - we are
recomputing it anyway. The committed word however will be necessary
to implement feature request #5968922.
Change-Id: I588c18e1a5a1050a791d601de465f421ccbe36cd
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. } } |