]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
My last change broke the test suite. Fix included. The start-indent should not be...
authorJeremias Maerki <jeremias@apache.org>
Wed, 25 Jan 2006 09:57:01 +0000 (09:57 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 25 Jan 2006 09:57:01 +0000 (09:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@372175 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
src/java/org/apache/fop/render/xml/XMLRenderer.java

index c5d322a82ca76a4f1af99eec9bc1c843849d48e9..601b5ca62d31986ddbe49fc0fca89c62368f7503 100644 (file)
@@ -1664,7 +1664,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
               = 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));
index d231569d50cceb290b60a7ac908f0356e76657e8..55881e1d1cc05c9746bf35e8733f8f6a441ecf59 100644 (file)
@@ -309,13 +309,14 @@ public class XMLRenderer extends PrintRenderer {
             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());
@@ -352,6 +353,10 @@ public class XMLRenderer extends PrintRenderer {
                         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());
                 }
@@ -681,9 +686,6 @@ public class XMLRenderer extends PrintRenderer {
         atts.clear();
         addAreaAttributes(line);
         addTraitAttributes(line);
-        if (line.getStartIndent() != 0) {
-            addAttribute("start-indent", line.getStartIndent());
-        }
         startElement("lineArea", atts);
         super.renderLineArea(line);
         endElement("lineArea");