diff options
| author | Leon Scroggins <scroggo@google.com> | 2010-03-09 15:14:03 -0500 |
|---|---|---|
| committer | Leon Scroggins <scroggo@google.com> | 2010-03-10 09:08:47 -0500 |
| commit | 62459c0fa5f379ab7aaaea3159654dd355117b37 (patch) | |
| tree | 44863c71b9cb656dc3cbc45f50cc7778454e250a /core/java/android/webkit/WebTextView.java | |
| parent | a401d559ecfb1c84f4016b5cc6b711581989dc3a (diff) | |
If the new text and old text are "", return from onTextChanged.
Fixes http://b/issue?id=2496329
Change-Id: I239f143c0e539710342e46783157344a4d7ccc08
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
| -rw-r--r-- | core/java/android/webkit/WebTextView.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index 39edcadf4ac4..016f0169261d 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -377,11 +377,17 @@ import java.util.ArrayList; return; } mPreChange = postChange; - // This was simply a delete or a cut, so just delete the selection. - if (before > 0 && 0 == count) { - mWebView.deleteSelection(start, start + before); - // For this and all changes to the text, update our cache - updateCachedTextfield(); + if (0 == count) { + if (before > 0) { + // This was simply a delete or a cut, so just delete the + // selection. + mWebView.deleteSelection(start, start + before); + // For this and all changes to the text, update our cache + updateCachedTextfield(); + } + // before should never be negative, so whether it was a cut + // (handled above), or before is 0, in which case nothing has + // changed, we should return. return; } // Find the last character being replaced. If it can be represented by |
