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

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

Issue 2279293002: Return null when selected text is empty (Closed)
Patch Set: fixed a failing test Created 4 years, 4 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 | content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java » ('j') | 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/TextInputState.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/TextInputState.java b/content/public/android/java/src/org/chromium/content/browser/input/TextInputState.java
index 444f23c474d546208d7fff488f8004f5e37d10f6..38684dfc9d9cfac2a51d79f0e630417255073812 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/TextInputState.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/TextInputState.java
@@ -53,6 +53,7 @@ public class TextInputState {
}
public CharSequence getSelectedText() {
+ if (mSelection.start() == mSelection.end()) return null;
return TextUtils.substring(mText, mSelection.start(), mSelection.end());
}
« no previous file with comments | « no previous file | content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698