= new LineArea((lbp.getLeafPos() < seq.size() - 1
? textAlignment : textAlignmentLast),
lbp.difference, lbp.availableStretch, lbp.availableShrink);
- lineArea.addTrait(Trait.START_INDENT, new Integer(lbp.startIndent));
+ if (lbp.startIndent != 0) {
+ lineArea.addTrait(Trait.START_INDENT, new Integer(lbp.startIndent));
+ }
lineArea.setBPD(lbp.lineHeight);
lineArea.setIPD(lbp.lineWidth);
lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
Iterator iter = traitMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry traitEntry = (Map.Entry) iter.next();
- String name = Trait.getTraitName(traitEntry.getKey());
- Class clazz = Trait.getTraitClass(traitEntry.getKey());
+ Object key = traitEntry.getKey();
+ String name = Trait.getTraitName(key);
+ Class clazz = Trait.getTraitClass(key);
if ("break-before".equals(name) || "break-after".equals(name)) {
continue;
}
Object value = traitEntry.getValue();
- if (Trait.getTraitName(Trait.FONT).equals(name)) {
+ if (key == Trait.FONT) {
FontTriplet triplet = (FontTriplet)value;
addAttribute("font-name", triplet.getName());
addAttribute("font-style", triplet.getStyle());
addAttribute("bkg-horz-offset", bkg.getHoriz());
addAttribute("bkg-vert-offset", bkg.getVertical());
}
+ } else if (key == Trait.START_INDENT || key == Trait.END_INDENT) {
+ if (((Integer)value).intValue() != 0) {
+ addAttribute(name, value.toString());
+ }
} else {
addAttribute(name, value.toString());
}
atts.clear();
addAreaAttributes(line);
addTraitAttributes(line);
- if (line.getStartIndent() != 0) {
- addAttribute("start-indent", line.getStartIndent());
- }
startElement("lineArea", atts);
super.renderLineArea(line);
endElement("lineArea");