Merge change I8f657a99 into eclair

* changes:
  Avoid a crash trying to get a substring whose start is after its end.
This commit is contained in:
Android (Google) Code Review
2009-12-14 17:41:15 -08:00

View File

@@ -4531,6 +4531,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// Now use the delta to determine the actual amount of text
// we need.
partialEndOffset += delta;
if (partialStartOffset > N) {
partialStartOffset = N;
} else if (partialStartOffset < 0) {
partialStartOffset = 0;
}
if (partialEndOffset > N) {
partialEndOffset = N;
} else if (partialEndOffset < 0) {