Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce4155a2 authored by Raph Levien's avatar Raph Levien
Browse files

Fix android.text.cts.StaticLayoutTest#testGetEllipsisCount

The "moreChars" predicate (which is used in ellipsis computation) was
slightly incorrect, sometimes being computed as false when the line
break is at the end of a paragraph but not the end of the buffer.
This patch makes the behavior consistent with shipping versions.

Bug: 19676414
Change-Id: I72e16794e895c2eb765b21feaf59fcdccc4857f1
parent 4771577a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -540,7 +540,7 @@ public class StaticLayout extends Layout {
                while (breakIndex < breakCount && paraStart + breaks[breakIndex] <= spanEnd) {
                    int endPos = paraStart + breaks[breakIndex];

                    boolean moreChars = (endPos < paraEnd); // XXX is this the right way to calculate this?
                    boolean moreChars = (endPos < bufEnd);

                    v = out(source, here, endPos,
                            fmAscent, fmDescent, fmTop, fmBottom,