aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/WordComposer.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-01-26 16:37:47 +0900
committerJean Chalard <jchalard@google.com>2012-01-26 18:25:08 +0900
commit2692a8700737d8eed268039aa27b22a31669da08 (patch)
treeddfa4a0d297596334da7ef3366911875c45fa346 /java/src/com/android/inputmethod/latin/WordComposer.java
parent1f8fc62ccb5018716457dc309ab11ad3e1506ad1 (diff)
downloadlatinime-2692a8700737d8eed268039aa27b22a31669da08.tar.gz
latinime-2692a8700737d8eed268039aa27b22a31669da08.tar.xz
latinime-2692a8700737d8eed268039aa27b22a31669da08.zip
Move some functionality into LastComposedWord (A3)
Change-Id: Ie0ea02a061dd0cb84db5f33113ff433584636bc7
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);
- }
}