diff options
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 |
