From 05f1c240b65132869d6bf5265c45e902d9d6ef83 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sun, 1 Mar 2009 12:25:29 +0000 Subject: Fixed BPD trait and border painting for leaders with leader-pattern="space" (and similar cases). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@749012 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/flow/Leader.java | 2 +- src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java | 8 +++----- src/java/org/apache/fop/render/AbstractRenderer.java | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/java/org') diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java index d72ed1e63..c25fc8cab 100644 --- a/src/java/org/apache/fop/fo/flow/Leader.java +++ b/src/java/org/apache/fop/fo/flow/Leader.java @@ -73,6 +73,7 @@ public class Leader extends InlineLevel { leaderLength = pList.get(PR_LEADER_LENGTH).getLengthRange(); leaderPattern = pList.get(PR_LEADER_PATTERN).getEnum(); leaderPatternWidth = pList.get(PR_LEADER_PATTERN_WIDTH).getLength(); + ruleThickness = pList.get(PR_RULE_THICKNESS).getLength(); switch(leaderPattern) { case EN_SPACE: // use Space @@ -81,7 +82,6 @@ public class Leader extends InlineLevel { // the following properties only apply // for leader-pattern = "rule" ruleStyle = pList.get(PR_RULE_STYLE).getEnum(); - ruleThickness = pList.get(PR_RULE_THICKNESS).getLength(); break; case EN_DOTS: break; diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java index f3bbc454a..f436059dc 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java @@ -120,17 +120,15 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { org.apache.fop.area.inline.Leader leader = new org.apache.fop.area.inline.Leader(); leader.setRuleStyle(fobj.getRuleStyle()); - leader.setRuleThickness(fobj.getRuleThickness().getValue(this)); - leader.setBPD(fobj.getRuleThickness().getValue(this)); leaderArea = leader; } else { leaderArea = new Space(); - leaderArea.setBPD(1); } + leaderArea.setBPD(fobj.getRuleThickness().getValue(this)); leaderArea.addTrait(Trait.COLOR, fobj.getColor()); } else if (fobj.getLeaderPattern() == EN_SPACE) { leaderArea = new Space(); - leaderArea.setBPD(1); + leaderArea.setBPD(fobj.getRuleThickness().getValue(this)); } else if (fobj.getLeaderPattern() == EN_DOTS) { TextArea t = new TextArea(); char dot = '.'; // userAgent.getLeaderDotCharacter(); @@ -198,7 +196,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { } else { //Content collapsed to nothing, so use a space leaderArea = new Space(); - leaderArea.setBPD(1); + leaderArea.setBPD(fobj.getRuleThickness().getValue(this)); } } TraitSetter.setProducerID(leaderArea, fobj.getId()); diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index 943c8c9da..0c324a0be 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -29,8 +29,11 @@ import java.util.Iterator; import java.util.List; import java.util.Set; +import org.w3c.dom.Document; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.area.Area; @@ -66,7 +69,6 @@ import org.apache.fop.area.inline.WordArea; import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.Constants; import org.apache.fop.fonts.FontInfo; -import org.w3c.dom.Document; /** * Abstract base class for all renderers. The Abstract renderer does all the @@ -648,7 +650,6 @@ public abstract class AbstractRenderer * @param space the space to render */ protected void renderInlineSpace(Space space) { - space.setBPD(0); renderInlineAreaBackAndBorders(space); // an inline space moves the inline progression position // for the current block by the width or height of the space -- cgit v1.2.3