From 4c334997f170e9ffb869fb2a6f29f6c4cb180879 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 16 Oct 2007 13:44:19 +0000 Subject: [PATCH] Bugzilla #43616: bug in the computation of remaining height that caused extra space to appear in tables git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@585141 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/table/ActiveCell.java | 6 +- .../table_stepper_bug43616.xml | 90 +++++++++++++++++++ 2 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 test/layoutengine/standard-testcases/table_stepper_bug43616.xml diff --git a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java index a06856d04..8af0b87a9 100644 --- a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java +++ b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java @@ -49,7 +49,7 @@ class ActiveCell { private int remainingLength; /** Heights of the rows (in the row-group) preceding the one where this cell starts. */ private int previousRowsLength; - /** Total length of this cell's content. */ + /** Total length of this cell's content plus the lengths of the previous rows. */ private int totalLength; /** Length of the Knuth elements already included in the steps. */ private int includedLength; @@ -93,7 +93,7 @@ class ActiveCell { includedLength = -1; // Avoid troubles with cells having content of zero length this.previousRowsLength = previousRowsLength; nextStepLength = previousRowsLength; - totalLength = ElementListUtils.calcContentLength(elementList); + totalLength = previousRowsLength + ElementListUtils.calcContentLength(elementList); if (pgu.getTable().isSeparateBorderModel()) { borderBefore = pgu.getBorders().getBorderBeforeWidth(false) + tableLM.getHalfBorderSeparationBPD(); @@ -109,7 +109,7 @@ class ActiveCell { end = -1; endRowIndex = rowIndex + pgu.getCell().getNumberRowsSpanned() - 1; keepWithNextSignal = false; - remainingLength = totalLength; + remainingLength = totalLength - previousRowsLength; goToNextLegalBreak(); } diff --git a/test/layoutengine/standard-testcases/table_stepper_bug43616.xml b/test/layoutengine/standard-testcases/table_stepper_bug43616.xml new file mode 100644 index 000000000..4f0825992 --- /dev/null +++ b/test/layoutengine/standard-testcases/table_stepper_bug43616.xml @@ -0,0 +1,90 @@ + + + + + +

+ This test checks that the combining algorithm for tables works properly. There was a bug in + the computation of remaining length that caused blank space to appear after the inner table. + Instead, the black and red border-after should be adjacent. +

+
+ + + + + + + + + + + + + + + + + + + + + Cell 1.1 + + + + + + + + Cell 2.1 Line 1 + Cell 2.1 Line 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-- 2.39.5