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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user