aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org')
-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());