aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-08-14 13:37:33 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-08-14 13:37:33 +0000
commit39f5b053cc82f71efa6014c36c0de2f36534bd19 (patch)
treedb7e342c32dea5c7dcbba7258b110c60578fc8f3 /src/java/org/apache/fop/layoutmgr
parent427e2d22a628b77cce5e7c22b32610b5ff23d8b2 (diff)
downloadxmlgraphics-fop-39f5b053cc82f71efa6014c36c0de2f36534bd19.tar.gz
xmlgraphics-fop-39f5b053cc82f71efa6014c36c0de2f36534bd19.zip
Merged revisions 685573,685785,685879,685885 via svnmerge from
https://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r685573 | jeremias | 2008-08-13 15:34:03 +0100 (Wed, 13 Aug 2008) | 1 line Fixed border trait parsing for the area tree XML when CMYK or ICC colors were used. ........ r685785 | jeremias | 2008-08-14 07:32:52 +0100 (Thu, 14 Aug 2008) | 1 line Removed three unused classes in the traits package. ........ r685879 | jeremias | 2008-08-14 14:03:20 +0100 (Thu, 14 Aug 2008) | 2 lines Fixed the source for a NullPointerException when the content of an fo:leader with leader-pattern="use-content" collapses to zero width during layout. ........ r685885 | acumiskey | 2008-08-14 14:25:54 +0100 (Thu, 14 Aug 2008) | 1 line Moved static method lightenColor() from PrintRenderer to ColorUtil. Thats one less Renderer interface dependency to worry about :). ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@685891 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr')
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
index 1e163bef8..f3bbc454a 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
@@ -183,17 +183,23 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
childContext.setAlignmentContext(context.getAlignmentContext());
contentList = clm.getNextKnuthElements(childContext, 0);
int width = clm.getStackingSize();
- Space spacer = null;
- if (fobj.getLeaderPatternWidth().getValue(this) > width) {
- spacer = new Space();
- spacer.setIPD(fobj.getLeaderPatternWidth().getValue(this) - width);
- width = fobj.getLeaderPatternWidth().getValue(this);
- }
- fa.setUnitWidth(width);
- if (spacer != null) {
- fa.addChildArea(spacer);
+ if (width != 0) {
+ Space spacer = null;
+ if (fobj.getLeaderPatternWidth().getValue(this) > width) {
+ spacer = new Space();
+ spacer.setIPD(fobj.getLeaderPatternWidth().getValue(this) - width);
+ width = fobj.getLeaderPatternWidth().getValue(this);
+ }
+ fa.setUnitWidth(width);
+ if (spacer != null) {
+ fa.addChildArea(spacer);
+ }
+ leaderArea = fa;
+ } else {
+ //Content collapsed to nothing, so use a space
+ leaderArea = new Space();
+ leaderArea.setBPD(1);
}
- leaderArea = fa;
}
TraitSetter.setProducerID(leaderArea, fobj.getId());
return leaderArea;