From: fotis Date: Thu, 1 Feb 2001 23:04:20 +0000 (+0000) Subject: fixed: leader didn't fill line in content table X-Git-Tag: fop-0_17_0~52 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b3e54b8ec3ba6ae480f4c591fe6981fc50165b6;p=xmlgraphics-fop.git fixed: leader didn't fill line in content table git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194009 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index cd3d1a8e4..27e985aa6 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -487,14 +487,18 @@ public class LineArea extends Area { int ruleStyle, int ruleThickness, int leaderPatternWidth, int leaderAlignment) { WordArea leaderPatternArea; - int leaderLength; + int leaderLength = 0; int remainingWidth = this.getContentWidth() - this.getCurrentXPosition(); - //checks whether leaderLenghtOptimum fits into rest of line; - //should never overflow, asit has been checked already in BlockArea - if (remainingWidth < leaderLengthOptimum) { + /** checks whether leaderLenghtOptimum fits into rest of line; + * should never overflow, as it has been checked already in BlockArea + * first check: use remaining width if it smaller than optimum oder maximum + * */ + if ((remainingWidth <= leaderLengthOptimum) || (remainingWidth <= leaderLengthMaximum)) { leaderLength = remainingWidth; - } else { + } else if ((remainingWidth > leaderLengthOptimum) && ( remainingWidth > leaderLengthMaximum)) { + leaderLength = leaderLengthMaximum; + } else if ((leaderLengthOptimum > leaderLengthMaximum) && (leaderLengthOptimum < remainingWidth)) { leaderLength = leaderLengthOptimum; } switch (leaderPattern) {