From 4b75aa4cd571bb6d8bee5a6c6fe581e3b20618c4 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Thu, 24 Jan 2008 21:10:22 +0000 Subject: [PATCH] Bugzilla #44289: Wrong border resolution when header/footer omitted at break git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@614993 13f79535-47bb-0310-9956-ffa450edef68 --- .../flow/table/CollapsingBorderResolver.java | 12 +- status.xml | 7 +- .../table_border-collapse_collapse_omitHF.xml | 147 ++++++++++++++++++ 3 files changed, 158 insertions(+), 8 deletions(-) create mode 100644 test/layoutengine/standard-testcases/table_border-collapse_collapse_omitHF.xml diff --git a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java index 235f05042..23f797a3e 100644 --- a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java +++ b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java @@ -362,10 +362,10 @@ class CollapsingBorderResolver implements BorderResolver { } else { // Trailing and rest borders already resolved with integrateTrailingBorders resolveBordersLastRowInTable(previousRow, false, true, false); - for (Iterator iter = previousRow.iterator(); iter.hasNext();) { - GridUnit gu = (GridUnit) iter.next(); - gu.borderAfter.leadingTrailing = gu.borderAfter.nonLeadingTrailing; - } + } + for (Iterator iter = previousRow.iterator(); iter.hasNext();) { + GridUnit gu = (GridUnit) iter.next(); + gu.borderAfter.leadingTrailing = gu.borderAfter.nonLeadingTrailing; } } } @@ -385,7 +385,7 @@ class CollapsingBorderResolver implements BorderResolver { if (part.isTableHeader()) { delegate = new ResolverInHeader(); } else { - if (leadingBorders == null) { + if (leadingBorders == null || table.omitHeaderAtBreak()) { // No header, leading borders determined by the table leadingBorders = new ArrayList(table.getNumberOfColumns()); for (Iterator colIter = table.getColumns().iterator(); colIter.hasNext();) { @@ -399,7 +399,7 @@ class CollapsingBorderResolver implements BorderResolver { resolverInFooter = new ResolverInFooter(); delegate = resolverInFooter; } else { - if (trailingBorders == null) { + if (trailingBorders == null || table.omitFooterAtBreak()) { // No footer, trailing borders determined by the table trailingBorders = new ArrayList(table.getNumberOfColumns()); for (Iterator colIter = table.getColumns().iterator(); colIter.hasNext();) { diff --git a/status.xml b/status.xml index c261f442b..a213a13be 100644 --- a/status.xml +++ b/status.xml @@ -28,9 +28,12 @@ + + Fixed the resolution of borders when header/footer is omitted at page breaks. + - Added support for conditional borders in tables, for both the separate and the collapsing - border model. + Added support for conditional borders in tables, for both the separate and the collapsing + border model. Fixed a possible IndexOutOfBoundsException that could happen with certain constellations diff --git a/test/layoutengine/standard-testcases/table_border-collapse_collapse_omitHF.xml b/test/layoutengine/standard-testcases/table_border-collapse_collapse_omitHF.xml new file mode 100644 index 000000000..d13b257c9 --- /dev/null +++ b/test/layoutengine/standard-testcases/table_border-collapse_collapse_omitHF.xml @@ -0,0 +1,147 @@ + + + + + +

+ This test checks that collapsed borders are correctly resolved when the table’s header or + footer is omitted at breaks. +

+
+ + + + + + + + + + + Before the table + + + + + Header 1.1 + + + Header 1.2 + + + + + Footer 1.1 + + + Footer 1.2 + + + + + + Cell 1.1 + Cell 1.1 + + + Cell 1.2 + Cell 1.2 + Cell 1.2 + Cell 1.2 + + + + + Cell 2.1 + Cell 2.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-- 2.39.5