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

Commit c5b814ec authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Improve ellipsize performance" into qt-dev am: 819dc46a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14904663

Change-Id: Ia1486957866ef76461718a679e956e7ee627cc7f
parents 538b54a1 819dc46a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2350,7 +2350,10 @@ public abstract class Layout {
        final int ellipsisStringLen = ellipsisString.length();
        // Use the ellipsis string only if there are that at least as many characters to replace.
        final boolean useEllipsisString = ellipsisCount >= ellipsisStringLen;
        for (int i = 0; i < ellipsisCount; i++) {
        final int min = Math.max(0, start - ellipsisStart - lineStart);
        final int max = Math.min(ellipsisCount, end - ellipsisStart - lineStart);

        for (int i = min; i < max; i++) {
            final char c;
            if (useEllipsisString && i < ellipsisStringLen) {
                c = ellipsisString.charAt(i);
@@ -2359,11 +2362,9 @@ public abstract class Layout {
            }

            final int a = i + ellipsisStart + lineStart;
            if (start <= a && a < end) {
            dest[destoff + a - start] = c;
        }
    }
    }

    /**
     * Stores information about bidirectional (left-to-right or right-to-left)