diff options
author | 2011-12-13 15:20:36 +0900 | |
---|---|---|
committer | 2011-12-13 16:04:11 +0900 | |
commit | d2c69c7d1231c238afc9196dcb9cc2359de520cf (patch) | |
tree | afb30ca7ce268e48ac836aac1ade34210aee8c68 /java/src | |
parent | 2245c3b5b3691928b08fd6accf8d4a21fb35e26b (diff) | |
download | latinime-d2c69c7d1231c238afc9196dcb9cc2359de520cf.tar.gz latinime-d2c69c7d1231c238afc9196dcb9cc2359de520cf.tar.xz latinime-d2c69c7d1231c238afc9196dcb9cc2359de520cf.zip |
Refactoring
If mHasUncommittedTypedChars is true, then
mWordSavedForAutoCorrectCancellation must always be null, and
spaceState must always be SPACE_STATE_NONE.
Hence, this change is supposed to be very no-op.
Change-Id: I2716f7372d996cc4dec40a4b7ac1ee7f5f4afe91
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 0299df446..f5875ca4a 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1411,7 +1411,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar return; } - final boolean deleteChar = !mHasUncommittedTypedChars; if (mHasUncommittedTypedChars) { final int length = mWordComposer.size(); if (length > 0) { @@ -1439,31 +1438,29 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // If we had uncommitted chars then we know it's not time to revert any auto-correct // and that spaceState is NONE. return; - } - - if (null != mWordSavedForAutoCorrectCancellation) { - Utils.Stats.onAutoCorrectionCancellation(); - cancelAutoCorrect(ic); - mWordSavedForAutoCorrectCancellation = null; - return; } else { - mWordSavedForAutoCorrectCancellation = null; - } - - if (SPACE_STATE_DOUBLE == spaceState) { - if (revertDoubleSpace(ic)) { - // No need to reset mSpaceState, it has already be done (that's why we - // receive it as a parameter) + if (null != mWordSavedForAutoCorrectCancellation) { + Utils.Stats.onAutoCorrectionCancellation(); + cancelAutoCorrect(ic); + mWordSavedForAutoCorrectCancellation = null; return; + } else { + mWordSavedForAutoCorrectCancellation = null; } - } else if (SPACE_STATE_SWAP_PUNCTUATION == spaceState) { - if (revertSwapPunctuation(ic)) { - // Likewise - return; + + if (SPACE_STATE_DOUBLE == spaceState) { + if (revertDoubleSpace(ic)) { + // No need to reset mSpaceState, it has already be done (that's why we + // receive it as a parameter) + return; + } + } else if (SPACE_STATE_SWAP_PUNCTUATION == spaceState) { + if (revertSwapPunctuation(ic)) { + // Likewise + return; + } } - } - if (deleteChar) { if (mSuggestionsView != null && mSuggestionsView.dismissAddToDictionaryHint()) { // Go back to the suggestion mode if the user canceled the // "Touch again to save". |