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

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

Issue 13820016: [Android] Remove zero length composing spans. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/input/AdapterInputConnection.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
index 045a54291d6bf7780321817c30a38325b8d589d7..68fb786f50974680e5d741cce6c88cea0519678e 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
@@ -151,7 +151,12 @@ public class AdapterInputConnection extends BaseInputConnection {
}
Selection.setSelection(editable, selectionStart, selectionEnd);
- super.setComposingRegion(compositionStart, compositionEnd);
+
+ if (compositionStart == compositionEnd) {
+ removeComposingSpans(editable);
+ } else {
+ super.setComposingRegion(compositionStart, compositionEnd);
+ }
if (mIgnoreTextInputStateUpdates) return;
updateSelection(selectionStart, selectionEnd, compositionStart, compositionEnd);
@@ -380,7 +385,12 @@ public class AdapterInputConnection extends BaseInputConnection {
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