From de61f78340ae23384e16ad675aefdd01ddf07c76 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 10 Mar 2010 10:55:58 -0800 Subject: Don't break lines in the middle of a smiley or other graphic replacement. The code that was supposed to keep this from happening was not being executed when the text was all ASCII. Bug 1899722 Change-Id: Ifc97a4423d6136e19abbc4c82eb36ac0216ce415 --- core/java/android/text/StaticLayout.java | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'core/java/android/text') diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 600ec7e..f02ad2a 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -233,25 +233,25 @@ extends Layout } } - if (!easy) { - // Ensure that none of the underlying characters are treated - // as viable breakpoints, and that the entire run gets the - // same bidi direction. + // Ensure that none of the underlying characters are treated + // as viable breakpoints, and that the entire run gets the + // same bidi direction. - if (source instanceof Spanned) { - Spanned sp = (Spanned) source; - ReplacementSpan[] spans = sp.getSpans(start, end, ReplacementSpan.class); + if (source instanceof Spanned) { + Spanned sp = (Spanned) source; + ReplacementSpan[] spans = sp.getSpans(start, end, ReplacementSpan.class); - for (int y = 0; y < spans.length; y++) { - int a = sp.getSpanStart(spans[y]); - int b = sp.getSpanEnd(spans[y]); + for (int y = 0; y < spans.length; y++) { + int a = sp.getSpanStart(spans[y]); + int b = sp.getSpanEnd(spans[y]); - for (int x = a; x < b; x++) { - chs[x - start] = '\uFFFC'; - } + for (int x = a; x < b; x++) { + chs[x - start] = '\uFFFC'; } } + } + if (!easy) { // XXX put override flags, etc. into chdirs dir = bidi(dir, chs, chdirs, n, false); -- cgit v1.1