aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/WordComposer.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-01-26 01:36:46 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-01-26 01:36:46 -0800
commit2f2f1f54035e5634f4d88a6a284c831e68f366a5 (patch)
treeddfa4a0d297596334da7ef3366911875c45fa346 /java/src/com/android/inputmethod/latin/WordComposer.java
parent183ba6a09e716934ccf445613dd9ea45c8d6e69f (diff)
parent2692a8700737d8eed268039aa27b22a31669da08 (diff)
downloadlatinime-2f2f1f54035e5634f4d88a6a284c831e68f366a5.tar.gz
latinime-2f2f1f54035e5634f4d88a6a284c831e68f366a5.tar.xz
latinime-2f2f1f54035e5634f4d88a6a284c831e68f366a5.zip
am 2692a870: Move some functionality into LastComposedWord (A3)
* commit '2692a8700737d8eed268039aa27b22a31669da08': Move some functionality into LastComposedWord (A3)
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index adadd9394..f97eb52f6 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -330,7 +330,7 @@ public class WordComposer {
}
// `type' should be one of the LastComposedWord.COMMIT_TYPE_* constants above.
- public LastComposedWord onCommitWord(final int type) {
+ public LastComposedWord commitWord(final int type) {
mCommittedWordSavedForSuggestionResuming = mCurrentWord;
// 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.
@@ -348,7 +348,9 @@ public class WordComposer {
}
final LastComposedWord lastComposedWord = new LastComposedWord(type, mCurrentWord.mCodes,
mCurrentWord.mXCoordinates, mCurrentWord.mYCoordinates,
- mCurrentWord.mTypedWord.toString(), mCurrentWord.mAutoCorrection.toString());
+ mCurrentWord.mTypedWord.toString(),
+ null == mCurrentWord.mAutoCorrection
+ ? null : mCurrentWord.mAutoCorrection.toString());
// TODO: improve performance by swapping buffers instead of creating a new object.
mCurrentWord = new CharacterStore();
return lastComposedWord;
@@ -362,11 +364,4 @@ public class WordComposer {
mCurrentWord = mCommittedWordSavedForSuggestionResuming;
mCommittedWordSavedForSuggestionResuming = null;
}
-
- public boolean didAutoCorrectToAnotherWord() {
- return null != mCommittedWordSavedForSuggestionResuming
- && !TextUtils.isEmpty(mCommittedWordSavedForSuggestionResuming.mAutoCorrection)
- && !TextUtils.equals(mCommittedWordSavedForSuggestionResuming.mTypedWord,
- mCommittedWordSavedForSuggestionResuming.mAutoCorrection);
- }
}