Automated import from //branches/master/...@142739,142739

This commit is contained in:
Eric Fischer
2009-03-25 15:51:17 -07:00
committed by The Android Open Source Project
parent c06a594d85
commit 09691cd15b

View File

@@ -152,10 +152,13 @@ public class Html {
next = text.nextSpanTransition(i, len, ParagraphStyle.class);
ParagraphStyle[] style = text.getSpans(i, next, ParagraphStyle.class);
String elements = " ";
boolean needDiv = false;
for(int j = 0; j < style.length; j++) {
if (style[j] instanceof AlignmentSpan) {
Layout.Alignment align =
((AlignmentSpan) style[j]).getAlignment();
needDiv = true;
if (align == Layout.Alignment.ALIGN_CENTER) {
elements = "align=\"center\" " + elements;
} else if (align == Layout.Alignment.ALIGN_OPPOSITE) {
@@ -165,13 +168,13 @@ public class Html {
}
}
}
if (style.length > 0) {
if (needDiv) {
out.append("<div " + elements + ">");
}
withinDiv(out, text, i, next);
if (style.length > 0) {
if (needDiv) {
out.append("</div>");
}
}