Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2041)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java

Issue 13820016: [Android] Remove zero length composing spans. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update supression moved to separate review Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
index 1f73502d70a17ff4705137121f602660c23553eb..96f70be81ed207bbc996db25ddafe4f58ac82fe5 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
@@ -549,7 +549,12 @@ class ImeAdapter {
}
Selection.setSelection(editable, selectionStart, selectionEnd);
- super.setComposingRegion(compositionStart, compositionEnd);
+
+ if (compositionStart == compositionEnd) {
+ removeComposingSpans(getEditable());
nilesh 2013/04/10 16:19:05 Is there a reason to not use the local var 'editab
Fredrik Öhrn 2013/04/10 16:23:08 Copy and paste laziness on my part, will fix.
+ } else {
+ super.setComposingRegion(compositionStart, compositionEnd);
+ }
if (mIgnoreTextInputStateUpdates) return;
updateSelection(selectionStart, selectionEnd, compositionStart, compositionEnd);
@@ -742,7 +747,11 @@ class ImeAdapter {
if (DEBUG) Log.w(TAG, "setComposingRegion [" + start + " " + end + "]");
int a = Math.min(start, end);
int b = Math.max(start, end);
- super.setComposingRegion(a, b);
+ if (a == b) {
+ removeComposingSpans(getEditable());
+ } else {
+ super.setComposingRegion(a, b);
+ }
return mImeAdapter.setComposingRegion(a, b);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698