Merge "Prevent a crash when maxLines is set to 0" into jb-dev

This commit is contained in:
Gilles Debunne
2012-06-12 10:47:31 -07:00
committed by Android (Google) Code Review

View File

@@ -456,6 +456,7 @@ public abstract class Layout {
final int top = Math.max(dtop, 0);
final int bottom = Math.min(getLineTop(getLineCount()), dbottom);
if (top >= bottom) return TextUtils.packRangeInLong(0, -1);
return TextUtils.packRangeInLong(getLineForVertical(top), getLineForVertical(bottom));
}