From 22cdf131f207ff063f84622d9f8054b68b9c5f6b Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 20 Nov 2007 16:07:32 +0000 Subject: Bugfix in tables: wrong element generation by the merging algorithm when glues must be produced to cope with conditional spaces. The corresponding length was added twice: one in the glue itself and one in the following box. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@596727 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/layoutmgr/table/TableStepper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/java/org/apache/fop') diff --git a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java index 7a92dbfd6..98b07778f 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java @@ -156,15 +156,15 @@ public class TableStepper { boolean signalKeepWithNext = false; int laststep = 0; int step; - int addedBoxLen = 0; + int cumulateLength = 0; // Length of the content accumulated before the break TableContentPosition lastTCPos = null; LinkedList returnList = new LinkedList(); while ((step = getNextStep()) >= 0) { int normalRow = activeRowIndex; int increase = step - laststep; int penaltyOrGlueLen = step + getMaxRemainingHeight() - totalHeight; - int boxLen = step - addedBoxLen - Math.max(0, penaltyOrGlueLen); - addedBoxLen += boxLen; + int boxLen = step - cumulateLength - Math.max(0, penaltyOrGlueLen)/* the penalty, if any */; + cumulateLength += boxLen + Math.max(0, -penaltyOrGlueLen)/* the glue, if any */; boolean forcedBreak = false; int breakClass = -1; -- cgit v1.2.3