diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2007-11-02 11:01:41 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2007-11-02 11:01:41 +0000 |
commit | 6f01fbd0f9ddeef6669b6b4850cb632772e6bdfb (patch) | |
tree | 2328cd62a6529018c42b97597481c7fe8ebd2009 /test/java | |
parent | a3d7ceee3d54b1290b4f705280002d5607a2c69a (diff) | |
download | xmlgraphics-fop-6f01fbd0f9ddeef6669b6b4850cb632772e6bdfb.tar.gz xmlgraphics-fop-6f01fbd0f9ddeef6669b6b4850cb632772e6bdfb.zip |
Reworked the creation of implicit columns to match new behaviour: the number of columns of a table without explicit fo:table-column is set by the row that has the most columns.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@591299 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r-- | test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java b/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java index 9ec83a26b..2af11c272 100644 --- a/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java +++ b/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java @@ -51,11 +51,11 @@ public class TableColumnColumnNumberTestCase extends AbstractTableTestCase { super(); } - private void checkColumn(Table t, int number, boolean isDefault, int spans, int repeated, int width) { + private void checkColumn(Table t, int number, boolean isImplicit, int spans, int repeated, int width) { TableColumn c = t.getColumn(number - 1); // TODO a repeated column has a correct number only for its first occurrence // assertEquals(number, c.getColumnNumber()); - assertEquals(isDefault, c.isDefaultColumn()); + assertEquals(isImplicit, c.isImplicitColumn()); assertEquals(spans, c.getNumberColumnsSpanned()); assertEquals(repeated, c.getNumberColumnsRepeated()); assertEquals(width, c.getColumnWidth().getValue(percentBaseContext)); @@ -88,4 +88,26 @@ public class TableColumnColumnNumberTestCase extends AbstractTableTestCase { checkColumn(t, 3, false, 1, 1, 150000); checkColumn(t, 4, false, 1, 1, 175000); } + + private void checkImplicitColumns(Iterator tableIter, int columnNumber) { + Table t = (Table) tableIter.next(); + assertEquals(columnNumber, t.getNumberOfColumns()); + for (int i = 1; i <= columnNumber; i++) { + checkColumn(t, i, true, 1, 1, 100000); + } + } + + public void testImplicitColumns() throws Exception { + setUp("table/implicit_columns_column-number.fo"); + percentBaseContext.setUnitaryWidth(100000); + Iterator tableIter = getTableHandler().getTables().iterator(); + + checkImplicitColumns(tableIter, 2); + checkImplicitColumns(tableIter, 2); + checkImplicitColumns(tableIter, 2); + checkImplicitColumns(tableIter, 2); + checkImplicitColumns(tableIter, 3); + checkImplicitColumns(tableIter, 4); + checkImplicitColumns(tableIter, 3); + } } |