From 22cdf131f207ff063f84622d9f8054b68b9c5f6b Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 20 Nov 2007 16:07:32 +0000 Subject: [PATCH] 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 --- .../org/apache/fop/layoutmgr/table/TableStepper.java | 6 +++--- status.xml | 9 +++++++-- .../table-cell_conditional-spaces_1.xml | 11 +++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) 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; diff --git a/status.xml b/status.xml index 3e4ad4b55..907487123 100644 --- a/status.xml +++ b/status.xml @@ -28,6 +28,11 @@ + + 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. + Bugfix for URI resolution: Make StreamSources without system identifier work again. @@ -35,8 +40,8 @@ Avoid a NullPointerException in AreaTreeHandler.endDocument(). - Bugfix: breaks generated by the merging algorithm for a table-row containing empty cells had always a - penalty of 900. + Bugfix: breaks generated by the merging algorithm for a table-row containing empty cells + had always a penalty of 900. Added methods for fo:page-number-citation(-last) in FOEventHandler. diff --git a/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml b/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml index a540cfefb..3aa9d8871 100644 --- a/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml +++ b/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml @@ -144,5 +144,16 @@ + + + 3 + + + + + + + 3 + -- 2.39.5