diff options
author | 2012-02-22 01:09:23 -0800 | |
---|---|---|
committer | 2012-02-22 01:09:23 -0800 | |
commit | 5935950d4431dd7eef18ebc370f2abeb614465d4 (patch) | |
tree | 284b10ca9a8f863f41b5d8199361d87059ffa12a /java/src | |
parent | 4fef31510df542a3324426a6750950194d016086 (diff) | |
download | latinime-5935950d4431dd7eef18ebc370f2abeb614465d4.tar.gz latinime-5935950d4431dd7eef18ebc370f2abeb614465d4.tar.xz latinime-5935950d4431dd7eef18ebc370f2abeb614465d4.zip |
Rename cancelCommit to revertCommit
This wording is easier to understand, and it matches the other
revert* functions.
Change-Id: Ibc2ec79fb5a0f9bf508e5cdeb75e54abd9241d0c
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LastComposedWord.java | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java index ab624b2cb..bc0792434 100644 --- a/java/src/com/android/inputmethod/latin/LastComposedWord.java +++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java @@ -72,7 +72,7 @@ public class LastComposedWord { mActive = false; } - public boolean canCancelCommit() { + public boolean canRevertCommit() { return mActive && !TextUtils.isEmpty(mCommittedWord); } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index a8ac3d545..47ec40f99 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1431,9 +1431,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar ic.deleteSurroundingText(1, 0); } } else { - if (mLastComposedWord.canCancelCommit()) { + if (mLastComposedWord.canRevertCommit()) { Utils.Stats.onAutoCorrectionCancellation(); - cancelCommit(ic); + revertCommit(ic); return; } if (SPACE_STATE_DOUBLE == spaceState) { @@ -2155,7 +2155,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } // "ic" must not be null - private void cancelCommit(final InputConnection ic) { + private void revertCommit(final InputConnection ic) { final String originallyTypedWord = mLastComposedWord.mTypedWord; final CharSequence committedWord = mLastComposedWord.mCommittedWord; final int cancelLength = committedWord.length(); @@ -2164,13 +2164,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // TODO: should we check our saved separator against the actual contents of the text view? if (DEBUG) { if (mWordComposer.isComposingWord()) { - throw new RuntimeException("cancelCommit, but we are composing a word"); + throw new RuntimeException("revertCommit, but we are composing a word"); } final String wordBeforeCursor = ic.getTextBeforeCursor(cancelLength + separatorLength, 0) .subSequence(0, cancelLength).toString(); if (!TextUtils.equals(committedWord, wordBeforeCursor)) { - throw new RuntimeException("cancelCommit check failed: we thought we were " + throw new RuntimeException("revertCommit check failed: we thought we were " + "reverting \"" + committedWord + "\", but before the cursor we found \"" + wordBeforeCursor + "\""); } |