aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorManuel Mall <manuel@apache.org>2005-11-13 16:06:51 +0000
committerManuel Mall <manuel@apache.org>2005-11-13 16:06:51 +0000
commitd5b198f09451d04a57226914ae7f68b66ea6d6fd (patch)
tree6fc777d9c55da14b8682d4c944e9307c90bfc88e /src/java/org/apache/fop
parent8d4c6805ee30385f9200b5fa02826a4bfbc5a6b9 (diff)
downloadxmlgraphics-fop-d5b198f09451d04a57226914ae7f68b66ea6d6fd.tar.gz
xmlgraphics-fop-d5b198f09451d04a57226914ae7f68b66ea6d6fd.zip
Initial fix for examples/basic/leader.fo problem
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@333041 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/area/inline/FilledArea.java9
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java7
2 files changed, 16 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/area/inline/FilledArea.java b/src/java/org/apache/fop/area/inline/FilledArea.java
index febc5ac98..9c3bcf4ca 100644
--- a/src/java/org/apache/fop/area/inline/FilledArea.java
+++ b/src/java/org/apache/fop/area/inline/FilledArea.java
@@ -75,6 +75,15 @@ public class FilledArea extends InlineParent {
}
/**
+ * Return the unit width for the areas to fill the full width.
+ *
+ * @return the unit width
+ */
+ public int getUnitWidth() {
+ return unitWidth;
+ }
+
+ /**
* Get the child areas for this filed area.
* This copies the references of the inline areas so that
* it fills the total width of the area a whole number of times
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
index f16b78553..ede040d21 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
@@ -233,6 +233,13 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
, context.getAlignmentContext());
ipd = getAllocationIPD(context.getRefIPD());
+ if (fobj.getLeaderPattern() == EN_USECONTENT && curArea instanceof FilledArea) {
+ // If we have user supplied content make it fit if we can
+ int unitWidth = ((FilledArea)curArea).getUnitWidth();
+ if (ipd.opt < unitWidth && ipd.max >= unitWidth) {
+ ipd.opt = unitWidth;
+ }
+ }
// create the AreaInfo object to store the computed values
areaInfo = new AreaInfo((short) 0, ipd, false, context.getAlignmentContext());