From e533832b11cea16e8599c549f015cab12c653f66 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Tue, 17 Apr 2012 21:34:52 +0000 Subject: [PATCH] Bugzilla #53086: Ensure that table footer and header are included in bididirectional resolution. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1327291 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fo/flow/table/Table.java | 23 +++++ status.xml | 3 + .../table_writing-mode_rl.xml | 91 +++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 test/layoutengine/standard-testcases/table_writing-mode_rl.xml diff --git a/src/java/org/apache/fop/fo/flow/table/Table.java b/src/java/org/apache/fop/fo/flow/table/Table.java index 304996f1c..a574723b1 100644 --- a/src/java/org/apache/fop/fo/flow/table/Table.java +++ b/src/java/org/apache/fop/fo/flow/table/Table.java @@ -20,11 +20,14 @@ package org.apache.fop.fo.flow.table; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.Stack; import org.xml.sax.Locator; import org.apache.fop.apps.FOPException; +import org.apache.fop.complexscripts.bidi.DelimitedTextRange; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.ValidationPercentBaseContext; import org.apache.fop.fo.FONode; @@ -597,4 +600,24 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder, Break RowGroupBuilder getRowGroupBuilder() { return rowGroupBuilder; } + + @Override + protected Stack collectDelimitedTextRanges ( Stack ranges, DelimitedTextRange currentRange ) { + // header sub-tree + TableHeader header = getTableHeader(); + if ( header != null ) { + ranges = header.collectDelimitedTextRanges ( ranges ); + } + // footer sub-tree + TableFooter footer = getTableFooter(); + if ( footer != null ) { + ranges = footer.collectDelimitedTextRanges ( ranges ); + } + // body sub-tree + for ( Iterator it = getChildNodes(); ( it != null ) && it.hasNext();) { + ranges = ( (FONode) it.next() ).collectDelimitedTextRanges ( ranges ); + } + return ranges; + } + } diff --git a/status.xml b/status.xml index 413ecfac1..67e2fb973 100644 --- a/status.xml +++ b/status.xml @@ -62,6 +62,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Ensure that table footer and header are included in bididirectional resolution. + Ensure writing-mode specified on fo:table is used to determine writing mode of table and its descendants. diff --git a/test/layoutengine/standard-testcases/table_writing-mode_rl.xml b/test/layoutengine/standard-testcases/table_writing-mode_rl.xml new file mode 100644 index 000000000..65927ec48 --- /dev/null +++ b/test/layoutengine/standard-testcases/table_writing-mode_rl.xml @@ -0,0 +1,91 @@ + + + + + +

+ This test checks table header, footer, and body cells all respect writing-mode="rl" specified on table. See also Bugzilla #53086. +

+
+ + + + + + + + + + + + + + + HEADER ROW + + + ABC + + + DEF + + + + + + + FOOTER ROW + + + ABC + + + DEF + + + + + + + BODY ROW + + + ABC + + + DEF + + + + + + + + + + + + + + + + + + + +
-- 2.39.5