From a8ba49c2534220105ce302a50b3a9ddaf831ef20 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 17 Jan 2012 11:55:23 +0900 Subject: Small cleanup The method deleteWordAtCursor would call finishComposingText, which is a very unexpected state change and would probably cause surprising bugs to any parent that would call it. As it happens, it's not used anywhere any more so let's just remove it. Change-Id: Iaa9200866e40b4e914f76baa987279948300679c --- .../src/com/android/inputmethod/latin/EditingUtils.java | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/EditingUtils.java') diff --git a/java/src/com/android/inputmethod/latin/EditingUtils.java b/java/src/com/android/inputmethod/latin/EditingUtils.java index 634dbbdfc..1e8ad1840 100644 --- a/java/src/com/android/inputmethod/latin/EditingUtils.java +++ b/java/src/com/android/inputmethod/latin/EditingUtils.java @@ -86,23 +86,6 @@ public class EditingUtils { return (r == null) ? null : r.mWord; } - /** - * Removes the word surrounding the cursor. Parameters are identical to - * getWordAtCursor. - */ - public static void deleteWordAtCursor(InputConnection connection, String separators) { - // getWordRangeAtCursor returns null if the connection is null - Range range = getWordRangeAtCursor(connection, separators); - if (range == null) return; - - connection.finishComposingText(); - // Move cursor to beginning of word, to avoid crash when cursor is outside - // of valid range after deleting text. - int newCursor = getCursorPosition(connection) - range.mCharsBefore; - connection.setSelection(newCursor, newCursor); - connection.deleteSurroundingText(0, range.mCharsBefore + range.mCharsAfter); - } - /** * Represents a range of text, relative to the current cursor position. */ -- cgit v1.2.3-83-g751a