From 345cb03315a0813ec57e44f97fc3fa4af6b3c309 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Wed, 16 Jun 2010 17:13:23 -0700 Subject: 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 --- core/java/android/text/TextLine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/java/android/text/TextLine.java') 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; } } -- cgit v1.2.3