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
main
Jean Chalard 2011-12-13 15:20:36 +09:00
parent 2245c3b5b3
commit d2c69c7d12
1 changed files with 19 additions and 22 deletions

View File

@ -1411,7 +1411,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
return; return;
} }
final boolean deleteChar = !mHasUncommittedTypedChars;
if (mHasUncommittedTypedChars) { if (mHasUncommittedTypedChars) {
final int length = mWordComposer.size(); final int length = mWordComposer.size();
if (length > 0) { if (length > 0) {
@ -1439,8 +1438,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// If we had uncommitted chars then we know it's not time to revert any auto-correct // If we had uncommitted chars then we know it's not time to revert any auto-correct
// and that spaceState is NONE. // and that spaceState is NONE.
return; return;
} } else {
if (null != mWordSavedForAutoCorrectCancellation) { if (null != mWordSavedForAutoCorrectCancellation) {
Utils.Stats.onAutoCorrectionCancellation(); Utils.Stats.onAutoCorrectionCancellation();
cancelAutoCorrect(ic); cancelAutoCorrect(ic);
@ -1463,7 +1461,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
} }
} }
if (deleteChar) {
if (mSuggestionsView != null && mSuggestionsView.dismissAddToDictionaryHint()) { if (mSuggestionsView != null && mSuggestionsView.dismissAddToDictionaryHint()) {
// Go back to the suggestion mode if the user canceled the // Go back to the suggestion mode if the user canceled the
// "Touch again to save". // "Touch again to save".