From 8e136f85f761fe6a31f45a2594405a2d6143716f Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Tue, 10 Jul 2012 14:30:45 -0700 Subject: [PATCH] Fix for bug 6716343. Use correct offset for mPos reset. DO NOT MERGE The mPos field in the MeasuredText object is relative to the start of the text (mTextStart), but the pos passed in by the caller of the setPos() method is relative to the character sequence. When spans overlap break boundaries and the paragraph doesn't start at 0, the result is an out of bounds error. This fix uses the correct offset. Change-Id: I64ef06df0eb06f75aedd25de97e9f347eeb52979 --- core/java/android/text/MeasuredText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/text/MeasuredText.java b/core/java/android/text/MeasuredText.java index 445aac63ae6b5..bd9310c1b1b22 100644 --- a/core/java/android/text/MeasuredText.java +++ b/core/java/android/text/MeasuredText.java @@ -83,7 +83,7 @@ class MeasuredText { } void setPos(int pos) { - mPos = pos; + mPos = pos - mTextStart; } /**