summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Gilles Debunne <debunne@google.com> 2010-06-16 17:13:23 -0700
committer Gilles Debunne <debunne@google.com> 2010-06-16 17:24:51 -0700
commit345cb03315a0813ec57e44f97fc3fa4af6b3c309 (patch)
treeb322373c09e07beca0ece0a836b58c7d2563b3dc
parent2f7a247c921ad1b86b7ba79cdb0431233827ad57 (diff)
Index out of range problem in TextLine.
Recent refactoring for bidi introduced an index shift in the getOffsetBeforeAfter method. This problem appears for multi-line text input only, when the text line mStart index is not 0. As a result, moving the cursor using the trackball in a multi-line EditText crashes. Change-Id: I1f121f0f9272ef7d338399f369ba6d77e1ca71c5
-rw-r--r--core/java/android/text/TextLine.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java
index e0ccbb41eb46..33c95548f905 100644
--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -54,7 +54,7 @@ class TextLine {
private char[] mChars;
private boolean mCharsValid;
private Spanned mSpanned;
- private TextPaint mWorkPaint = new TextPaint();
+ private final TextPaint mWorkPaint = new TextPaint();
private static TextLine[] cached = new TextLine[3];
@@ -658,7 +658,7 @@ class TextLine {
flags, offset, cursorOpt);
} else {
return wp.getTextRunCursor(mText, mStart + spanStart,
- mStart + spanLimit, flags, mStart + offset, cursorOpt);
+ mStart + spanLimit, flags, mStart + offset, cursorOpt) - mStart;
}
}