diff options
author | 2014-03-25 22:41:23 +0900 | |
---|---|---|
committer | 2014-04-02 17:58:33 +0900 | |
commit | 8bb2e99aefd6d98032f00d7d7fa917220d99188a (patch) | |
tree | a1bd75024259f59249b2a309d29ad863c0dcd3dd /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | 3285b68c97d966d86c08aeb837e5bf5633981357 (diff) | |
download | latinime-8bb2e99aefd6d98032f00d7d7fa917220d99188a.tar.gz latinime-8bb2e99aefd6d98032f00d7d7fa917220d99188a.tar.xz latinime-8bb2e99aefd6d98032f00d7d7fa917220d99188a.zip |
[CB18] Move some code around
Bring next to each other two methods scheduled for a merge
Bug: 13406701
Change-Id: I335c7202cc07d8865f4ab92e4023c1d93d1f83ac
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index ad41d2a19..50bc2b0a2 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -200,6 +200,33 @@ public final class WordComposer { mAutoCorrection = null; } + /** + * Delete the last composing unit as a result of hitting backspace. + */ + public void deleteLast(final Event event) { + mCombinerChain.processEvent(mEvents, event); + mEvents.add(event); + refreshTypedWordCache(); + // We may have deleted the last one. + if (0 == size()) { + mIsFirstCharCapitalized = false; + } + if (mTrailingSingleQuotesCount > 0) { + --mTrailingSingleQuotesCount; + } else { + int i = mTypedWordCache.length(); + while (i > 0) { + i = Character.offsetByCodePoints(mTypedWordCache, i, -1); + if (Constants.CODE_SINGLE_QUOTE != Character.codePointAt(mTypedWordCache, i)) { + break; + } + ++mTrailingSingleQuotesCount; + } + } + mCursorPositionWithinWord = mCodePointSize; + mAutoCorrection = null; + } + public void setCursorPositionWithinWord(final int posWithinWord) { mCursorPositionWithinWord = posWithinWord; // TODO: compute where that puts us inside the events @@ -297,33 +324,6 @@ public final class WordComposer { } /** - * Delete the last composing unit as a result of hitting backspace. - */ - public void deleteLast(final Event event) { - mCombinerChain.processEvent(mEvents, event); - mEvents.add(event); - refreshTypedWordCache(); - // We may have deleted the last one. - if (0 == size()) { - mIsFirstCharCapitalized = false; - } - if (mTrailingSingleQuotesCount > 0) { - --mTrailingSingleQuotesCount; - } else { - int i = mTypedWordCache.length(); - while (i > 0) { - i = Character.offsetByCodePoints(mTypedWordCache, i, -1); - if (Constants.CODE_SINGLE_QUOTE != Character.codePointAt(mTypedWordCache, i)) { - break; - } - ++mTrailingSingleQuotesCount; - } - } - mCursorPositionWithinWord = mCodePointSize; - mAutoCorrection = null; - } - - /** * Returns the word as it was typed, without any correction applied. * @return the word that was typed so far. Never returns null. */ |