summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2011-11-17 08:49:50 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2011-11-17 08:49:50 -0800
commit0551287f6ed06511feae2a6b3700a9bca4cfc3cd (patch)
tree038055b4611f05c94c387a1289a688d37eecaaaa
parent2c6afef8766371bf933f8675c80687802ce045e0 (diff)
parent775e986ece16b90d3260fe8c7f8e18fc3d0cf492 (diff)
am 775e986e: Merge "Fix add single character check" into ics-mr1
* commit '775e986ece16b90d3260fe8c7f8e18fc3d0cf492': Fix add single character check
-rw-r--r--core/java/android/webkit/WebTextView.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 8aafc3d078fe..8c7a49c49447 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -567,7 +567,6 @@ import java.util.ArrayList;
mPreChange.substring(0, mMaxLength).equals(postChange))) {
return;
}
- mPreChange = postChange;
if (0 == count) {
if (before > 0) {
// For this and all changes to the text, update our cache
@@ -605,9 +604,9 @@ import java.util.ArrayList;
// Prefer sending javascript events, so when adding one character,
// don't replace the unchanged text.
if (count > 1 && before == count - 1) {
- String replaceButOne = s.subSequence(start,
+ String replaceButOne = mPreChange.subSequence(start,
start + before).toString();
- String replacedString = getText().subSequence(start,
+ String replacedString = s.subSequence(start,
start + before).toString();
if (replaceButOne.equals(replacedString)) {
// we're just adding one character
@@ -616,6 +615,7 @@ import java.util.ArrayList;
count = 1;
}
}
+ mPreChange = postChange;
// Find the last character being replaced. If it can be represented by
// events, we will pass them to native so we can see javascript events.
// Otherwise, replace the text being changed in the textfield.