From 5b3e54b8ec3ba6ae480f4c591fe6981fc50165b6 Mon Sep 17 00:00:00 2001 From: fotis Date: Thu, 1 Feb 2001 23:04:20 +0000 Subject: [PATCH] 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 --- src/org/apache/fop/layout/LineArea.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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) { -- 2.39.5