- Set up a framework for unit-testing classes from the FO tree, and added some first testcases for the number of columns in tables. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@590705 13f79535-47bb-0310-9956-ffa450edef68tags/fop-0_95beta
@@ -83,6 +83,8 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder { | |||
private boolean tableFooterFound = false; | |||
private boolean tableBodyFound = false; | |||
private boolean hasExplicitColumns = false; | |||
/** | |||
* The table's property list. Used in case the table has | |||
* no explicit columns, as a parent property list to | |||
@@ -236,6 +238,7 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder { | |||
switch (childId) { | |||
case FO_TABLE_COLUMN: | |||
hasExplicitColumns = true; | |||
if (!inMarker()) { | |||
addColumnNode((TableColumn) child); | |||
} else { | |||
@@ -313,6 +316,10 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder { | |||
columnNumberManager.signalUsedColumnNumbers(colNumber, colNumber + colRepeat - 1); | |||
} | |||
boolean hasExplicitColumns() { | |||
return hasExplicitColumns; | |||
} | |||
/** @return true of table-layout="auto" */ | |||
public boolean isAutoLayout() { | |||
return (tableLayout == EN_AUTO); |
@@ -24,6 +24,7 @@ import java.util.List; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.datatypes.Length; | |||
import org.apache.fop.fo.FONode; | |||
import org.apache.fop.fo.ValidationException; | |||
/** | |||
* A common class for fo:table-body and fo:table-row which both can contain fo:table-cell. | |||
@@ -66,6 +67,12 @@ public abstract class TableCellContainer extends TableFObj implements ColumnNumb | |||
int colSpan = cell.getNumberColumnsSpanned(); | |||
int rowSpan = cell.getNumberRowsSpanned(); | |||
Table t = getTable(); | |||
if (t.hasExplicitColumns() && colNumber + colSpan - 1 > t.getNumberOfColumns()) { | |||
throw new ValidationException(FONode.errorText(locator) + "column-number or number " | |||
+ "of cells in the row overflows the number of fo:table-column specified " | |||
+ "for the table."); | |||
} | |||
if (firstRow) { | |||
handleCellWidth(cell, colNumber, colSpan); | |||
updatePendingSpansSize(cell, colNumber, colSpan); |
@@ -41,63 +41,55 @@ | |||
<fo:table-body> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="1" /> | |||
<fo:block>cell1</fo:block> | |||
<fo:block>cell 1.1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="2" /> | |||
<fo:block>cell2</fo:block> | |||
<fo:block>cell 1.2</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="3" /> | |||
<fo:block>cell3</fo:block> | |||
<fo:block>cell 1.3</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="4" /> | |||
<fo:block>cell4</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="5" /> | |||
<fo:block>cell5</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="6" /> | |||
<fo:block>cell5b</fo:block> | |||
<fo:block>cell 1.4</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell starts-row="true"> | |||
<test:assert property="column-number" expected="1" /> | |||
<fo:block>cell6</fo:block> | |||
<fo:block>cell 2.1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="2" /> | |||
<fo:block>cell7</fo:block> | |||
<fo:block>cell 2.2</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell ends-row="true"> | |||
<test:assert property="column-number" expected="3" /> | |||
<fo:block>cell8</fo:block> | |||
<fo:block>cell 2.3</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="1" /> | |||
<fo:block>cell9</fo:block> | |||
<fo:block>cell 3.1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="2" /> | |||
<fo:block>cell10</fo:block> | |||
<fo:block>cell 3.2</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<test:assert property="column-number" expected="3" /> | |||
<fo:block>cell11</fo:block> | |||
<fo:block>cell 3.3</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell ends-row="true"> | |||
<test:assert property="column-number" expected="4" /> | |||
<fo:block>cell12</fo:block> | |||
<fo:block>cell 3.4</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell starts-row="true" ends-row="true"> | |||
<test:assert property="column-number" expected="1" /> | |||
<fo:block>cell13</fo:block> | |||
<fo:block>cell 4.1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell ends-row="true"> | |||
<test:assert property="column-number" expected="1" /> | |||
<fo:block>cell14</fo:block> | |||
<fo:block>cell 5.1</fo:block> | |||
</fo:table-cell> | |||
</fo:table-body> | |||
</fo:table> |
@@ -0,0 +1,48 @@ | |||
<?xml version="1.0" standalone="no"?> | |||
<!-- | |||
Licensed to the Apache Software Foundation (ASF) under one or more | |||
contributor license agreements. See the NOTICE file distributed with | |||
this work for additional information regarding copyright ownership. | |||
The ASF licenses this file to You under the Apache License, Version 2.0 | |||
(the "License"); you may not use this file except in compliance with | |||
the License. You may obtain a copy of the License at | |||
http://www.apache.org/licenses/LICENSE-2.0 | |||
Unless required by applicable law or agreed to in writing, software | |||
distributed under the License is distributed on an "AS IS" BASIS, | |||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
--> | |||
<!-- $Id$ --> | |||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |||
<fo:layout-master-set> | |||
<fo:simple-page-master master-name="page" page-height="10cm" page-width="15cm" margin="10pt"> | |||
<fo:region-body/> | |||
</fo:simple-page-master> | |||
</fo:layout-master-set> | |||
<fo:page-sequence master-reference="page"> | |||
<fo:flow flow-name="xsl-region-body"> | |||
<fo:block space-after="10pt">The following table has a row which contains too many | |||
columns.</fo:block> | |||
<fo:table table-layout="fixed" border-collapse="separate" width="100%"> | |||
<fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/> | |||
<fo:table-body> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 1.1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 1.2</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 1.3</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell border="1pt solid black" starts-row="true"> | |||
<fo:block>Cell 2.1</fo:block> | |||
</fo:table-cell> | |||
</fo:table-body> | |||
</fo:table> | |||
</fo:flow> | |||
</fo:page-sequence> | |||
</fo:root> |
@@ -0,0 +1,51 @@ | |||
<?xml version="1.0" standalone="no"?> | |||
<!-- | |||
Licensed to the Apache Software Foundation (ASF) under one or more | |||
contributor license agreements. See the NOTICE file distributed with | |||
this work for additional information regarding copyright ownership. | |||
The ASF licenses this file to You under the Apache License, Version 2.0 | |||
(the "License"); you may not use this file except in compliance with | |||
the License. You may obtain a copy of the License at | |||
http://www.apache.org/licenses/LICENSE-2.0 | |||
Unless required by applicable law or agreed to in writing, software | |||
distributed under the License is distributed on an "AS IS" BASIS, | |||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
--> | |||
<!-- $Id$ --> | |||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |||
<fo:layout-master-set> | |||
<fo:simple-page-master master-name="page" page-height="10cm" page-width="15cm" margin="10pt"> | |||
<fo:region-body/> | |||
</fo:simple-page-master> | |||
</fo:layout-master-set> | |||
<fo:page-sequence master-reference="page"> | |||
<fo:flow flow-name="xsl-region-body"> | |||
<fo:block space-after="10pt">The following table has a row which contains too many | |||
columns.</fo:block> | |||
<fo:table table-layout="fixed" border-collapse="separate" width="100%"> | |||
<fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/> | |||
<fo:table-body> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 1.1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell border="1pt solid black" ends-row="true"> | |||
<fo:block>Cell 1.2</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 2.1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 2.2</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 2.3</fo:block> | |||
</fo:table-cell> | |||
</fo:table-body> | |||
</fo:table> | |||
</fo:flow> | |||
</fo:page-sequence> | |||
</fo:root> |
@@ -0,0 +1,56 @@ | |||
<?xml version="1.0" standalone="no"?> | |||
<!-- | |||
Licensed to the Apache Software Foundation (ASF) under one or more | |||
contributor license agreements. See the NOTICE file distributed with | |||
this work for additional information regarding copyright ownership. | |||
The ASF licenses this file to You under the Apache License, Version 2.0 | |||
(the "License"); you may not use this file except in compliance with | |||
the License. You may obtain a copy of the License at | |||
http://www.apache.org/licenses/LICENSE-2.0 | |||
Unless required by applicable law or agreed to in writing, software | |||
distributed under the License is distributed on an "AS IS" BASIS, | |||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
--> | |||
<!-- $Id$ --> | |||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |||
<fo:layout-master-set> | |||
<fo:simple-page-master master-name="page" page-height="10cm" page-width="15cm" margin="10pt"> | |||
<fo:region-body/> | |||
</fo:simple-page-master> | |||
</fo:layout-master-set> | |||
<fo:page-sequence master-reference="page"> | |||
<fo:flow flow-name="xsl-region-body"> | |||
<fo:block space-after="10pt">The following table has a row which contains too many | |||
columns.</fo:block> | |||
<fo:table table-layout="fixed" border-collapse="separate" width="100%"> | |||
<fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 1.1</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 1.2</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row> | |||
<fo:table-cell border="1pt solid black"> | |||
<fo:block>Cell 2.1</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row> | |||
<fo:table-cell border="1pt solid black" column-number="3"> | |||
<fo:block>Cell 2.3</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
</fo:table-body> | |||
</fo:table> | |||
</fo:flow> | |||
</fo:page-sequence> | |||
</fo:root> |
@@ -0,0 +1,45 @@ | |||
/* | |||
* Licensed to the Apache Software Foundation (ASF) under one or more | |||
* contributor license agreements. See the NOTICE file distributed with | |||
* this work for additional information regarding copyright ownership. | |||
* The ASF licenses this file to You under the Apache License, Version 2.0 | |||
* (the "License"); you may not use this file except in compliance with | |||
* the License. You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
/* $Id$ */ | |||
package org.apache.fop.fo.flow; | |||
import java.util.LinkedList; | |||
import java.util.List; | |||
import org.apache.fop.apps.FOUserAgent; | |||
import org.apache.fop.fo.FOEventHandler; | |||
import org.apache.fop.fo.flow.Table; | |||
public class TableHandler extends FOEventHandler { | |||
/** All the tables encountered in the FO file. List of Table objects. */ | |||
private List tables = new LinkedList(); | |||
TableHandler(FOUserAgent foUserAgent) { | |||
super(foUserAgent); | |||
} | |||
public void endTable(Table tbl) { | |||
tables.add(tbl); | |||
} | |||
List getTables() { | |||
return tables; | |||
} | |||
} |
@@ -0,0 +1,60 @@ | |||
/* | |||
* Licensed to the Apache Software Foundation (ASF) under one or more | |||
* contributor license agreements. See the NOTICE file distributed with | |||
* this work for additional information regarding copyright ownership. | |||
* The ASF licenses this file to You under the Apache License, Version 2.0 | |||
* (the "License"); you may not use this file except in compliance with | |||
* the License. You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
/* $Id$ */ | |||
package org.apache.fop.fo.flow; | |||
import org.apache.fop.apps.FOUserAgent; | |||
import org.apache.fop.fo.FOEventHandler; | |||
import org.apache.fop.fo.ValidationException; | |||
import org.apache.fop.fotreetest.FOTreeUnitTester; | |||
public class TooManyColumnsTestCase extends FOTreeUnitTester { | |||
private FOTreeUnitTester.FOEventHandlerFactory tableHandlerFactory; | |||
public TooManyColumnsTestCase() throws Exception { | |||
super(); | |||
tableHandlerFactory = new FOTreeUnitTester.FOEventHandlerFactory() { | |||
public FOEventHandler createFOEventHandler(FOUserAgent ua) { | |||
return new TableHandler(ua); | |||
} | |||
}; | |||
} | |||
private void launchTest(String filename) throws Exception { | |||
try { | |||
setUp(filename, tableHandlerFactory); | |||
fail(); | |||
} catch (ValidationException e) { | |||
// TODO check location | |||
} | |||
} | |||
public void testBody1() throws Exception { | |||
launchTest("table/too-many-columns_body_1.fo"); | |||
} | |||
public void testBody2() throws Exception { | |||
launchTest("table/too-many-columns_body_2.fo"); | |||
} | |||
public void testBody3() throws Exception { | |||
launchTest("table/too-many-columns_body_3.fo"); | |||
} | |||
} |
@@ -32,6 +32,7 @@ import org.apache.commons.io.filefilter.PrefixFileFilter; | |||
import org.apache.commons.io.filefilter.SuffixFileFilter; | |||
import org.apache.commons.io.filefilter.TrueFileFilter; | |||
import org.apache.fop.DebugHelper; | |||
import org.apache.fop.fo.flow.TooManyColumnsTestCase; | |||
import org.apache.fop.layoutengine.LayoutEngineTestSuite; | |||
import junit.framework.Test; | |||
@@ -57,7 +58,12 @@ public final class FOTreeTestSuite { | |||
*/ | |||
public static Test suite() throws IOException { | |||
TestSuite suite = new TestSuite(); | |||
addXMLTestCases(suite); | |||
addUnitTestCases(suite); | |||
return suite; | |||
} | |||
private static void addXMLTestCases(TestSuite suite) throws IOException { | |||
File mainDir = new File("test/fotree"); | |||
final FOTreeTester tester = new FOTreeTester(); | |||
@@ -88,8 +94,6 @@ public final class FOTreeTestSuite { | |||
File f = (File)i.next(); | |||
addTestCase(suite, tester, f); | |||
} | |||
return suite; | |||
} | |||
private static void addTestCase(TestSuite suite, | |||
@@ -102,7 +106,11 @@ public final class FOTreeTestSuite { | |||
} | |||
}); | |||
} | |||
private static void addUnitTestCases(TestSuite suite) { | |||
suite.addTestSuite(TooManyColumnsTestCase.class); | |||
} | |||
private static class FOTreeTestCase extends TestCase { | |||
private FOTreeTester tester; |
@@ -0,0 +1,95 @@ | |||
/* | |||
* Licensed to the Apache Software Foundation (ASF) under one or more | |||
* contributor license agreements. See the NOTICE file distributed with | |||
* this work for additional information regarding copyright ownership. | |||
* The ASF licenses this file to You under the Apache License, Version 2.0 | |||
* (the "License"); you may not use this file except in compliance with | |||
* the License. You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
/* $Id$ */ | |||
package org.apache.fop.fotreetest; | |||
import java.io.File; | |||
import javax.xml.parsers.SAXParser; | |||
import javax.xml.parsers.SAXParserFactory; | |||
import junit.framework.TestCase; | |||
import org.apache.fop.apps.FOUserAgent; | |||
import org.apache.fop.apps.Fop; | |||
import org.apache.fop.apps.FopFactory; | |||
import org.apache.fop.fo.FOEventHandler; | |||
import org.xml.sax.XMLReader; | |||
/** | |||
* Base class for unit-testing the FO tree building code. It performs the necessary setup | |||
* to parse an FO file and register a proper {@link FOEventHandler}. That handler will be | |||
* the entry point to test classes from the FObj hierarchy. | |||
*/ | |||
public abstract class FOTreeUnitTester extends TestCase { | |||
private XMLReader foReader; | |||
private FopFactory fopFactory; | |||
/** | |||
* Should be implemented by children testcases for properly setting up the custom | |||
* FOEventHandler needed to test FObj classes. | |||
*/ | |||
public abstract static class FOEventHandlerFactory { | |||
/** | |||
* This method is called by FOTreeUnitTester when creating a {@link Fop} instance. | |||
* That lets pass to the custom FOEventHandler the proper user agent that will be | |||
* used by this instance. | |||
* | |||
* @param foUserAgent the user agent needed by the Fop instance that will be used | |||
* to create the FO tree | |||
* @return the appropriate FOEventHandler for performing the tests | |||
*/ | |||
public abstract FOEventHandler createFOEventHandler(FOUserAgent foUserAgent); | |||
} | |||
public FOTreeUnitTester() throws Exception { | |||
// Stuff that needs to be set up only once and will be re-used for each test | |||
SAXParserFactory spf = SAXParserFactory.newInstance(); | |||
spf.setNamespaceAware(true); | |||
spf.setValidating(false); | |||
SAXParser parser; | |||
parser = spf.newSAXParser(); | |||
foReader = parser.getXMLReader(); | |||
fopFactory = FopFactory.newInstance(); | |||
} | |||
/** | |||
* Launches FOP on the given FO file. | |||
* | |||
* @param filename path to the test FO file | |||
* @param factory to create the appropriate FOEventHandler for performing tests | |||
*/ | |||
public void setUp(String filename, FOEventHandlerFactory factory) throws Exception { | |||
FOUserAgent ua = fopFactory.newFOUserAgent(); | |||
ua.setFOEventHandlerOverride(factory.createFOEventHandler(ua)); | |||
Fop fop = fopFactory.newFop(ua); | |||
foReader.setContentHandler(fop.getDefaultHandler()); | |||
foReader.setDTDHandler(fop.getDefaultHandler()); | |||
foReader.setErrorHandler(fop.getDefaultHandler()); | |||
foReader.setEntityResolver(fop.getDefaultHandler()); | |||
foReader.parse(new File("test/fotree/unittests/" + filename).toURL().toExternalForm()); | |||
} | |||
} |
@@ -36,6 +36,7 @@ | |||
<fo:table-column column-width="1in"/> | |||
<fo:table-column column-width="1in"/> | |||
<fo:table-column column-width="1in"/> | |||
<fo:table-column column-width="1in"/> | |||
<fo:table-body> | |||
<fo:table-cell> | |||
<fo:block>cell1</fo:block> |
@@ -1,75 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- | |||
Licensed to the Apache Software Foundation (ASF) under one or more | |||
contributor license agreements. See the NOTICE file distributed with | |||
this work for additional information regarding copyright ownership. | |||
The ASF licenses this file to You under the Apache License, Version 2.0 | |||
(the "License"); you may not use this file except in compliance with | |||
the License. You may obtain a copy of the License at | |||
http://www.apache.org/licenses/LICENSE-2.0 | |||
Unless required by applicable law or agreed to in writing, software | |||
distributed under the License is distributed on an "AS IS" BASIS, | |||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
--> | |||
<!-- $Id$ --> | |||
<testcase> | |||
<info> | |||
<p> | |||
This test checks if FOP can handle the case where more columns are actually used than | |||
specified. | |||
</p> | |||
<p> | |||
Note: This test case is technically wrong since in fixed table layout all | |||
column-widths must be specified. But we don't want to have FOP crash | |||
with an IndexOutOfBoundsException either. | |||
</p> | |||
</info> | |||
<fo> | |||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |||
<fo:layout-master-set> | |||
<fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> | |||
<fo:region-body/> | |||
</fo:simple-page-master> | |||
</fo:layout-master-set> | |||
<fo:page-sequence master-reference="normal"> | |||
<fo:flow flow-name="xsl-region-body"> | |||
<fo:table table-layout="fixed" width="100%" border-collapse="separate"> | |||
<fo:table-column width="2cm"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell> | |||
<fo:block>cell 1/1</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row> | |||
<fo:table-cell> | |||
<fo:block>cell 2/1</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block>cell 2/2</fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block>cell 2/3</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
</fo:table-body> | |||
</fo:table> | |||
</fo:flow> | |||
</fo:page-sequence> | |||
</fo:root> | |||
</fo> | |||
<checks> | |||
<eval expected="14400" xpath="//flow/block/block[2]/@top-offset"/> | |||
<eval expected="14400" xpath="//flow/block/block[3]/@top-offset"/> | |||
<eval expected="14400" xpath="//flow/block/block[4]/@top-offset"/> | |||
<eval expected="360000" xpath="//flow/block/block[3]/@left-offset"/> | |||
<eval expected="720000" xpath="//flow/block/block[4]/@left-offset"/> | |||
<eval expected="360000" xpath="//flow/block/block[3]/@ipd"/> | |||
<eval expected="360000" xpath="//flow/block/block[4]/@ipd"/> | |||
</checks> | |||
</testcase> |
@@ -36,7 +36,7 @@ | |||
<fo:flow flow-name="xsl-region-body"> | |||
<fo:block space-after="80pt">Before the table</fo:block> | |||
<fo:table width="100%" table-layout="fixed" border="4pt solid black"> | |||
<fo:table-column number-columns-repeated="2" | |||
<fo:table-column number-columns-repeated="3" | |||
column-width="proportional-column-width(1)"/> | |||
<fo:table-body> | |||
<fo:table-row> |
@@ -35,7 +35,8 @@ | |||
<!-- table 1 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell border="6pt solid black"> | |||
@@ -51,7 +52,8 @@ | |||
<!-- table 2 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell border="10pt solid black"> | |||
@@ -67,7 +69,8 @@ | |||
<!-- table 3 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell | |||
@@ -91,7 +94,8 @@ | |||
<!-- table 4 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell |
@@ -37,7 +37,8 @@ | |||
<!-- table 1 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell |
@@ -35,7 +35,8 @@ | |||
<fo:block>Before the tables</fo:block> | |||
<!-- table 1 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell number-rows-spanned="2" | |||
@@ -69,7 +70,8 @@ | |||
<fo:block>Between tables</fo:block> | |||
<!-- table 2 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell | |||
@@ -104,7 +106,8 @@ | |||
<fo:block>Between tables</fo:block> | |||
<!-- table 3 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell number-columns-spanned="2" | |||
@@ -142,7 +145,8 @@ | |||
<fo:block>Between tables</fo:block> | |||
<!-- table 4 --> | |||
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse"> | |||
<fo:table-column column-width="proportional-column-width(1)"/> | |||
<fo:table-column column-width="proportional-column-width(1)" | |||
number-columns-repeated="2"/> | |||
<fo:table-body> | |||
<fo:table-row> | |||
<fo:table-cell | |||
@@ -221,7 +225,7 @@ | |||
<eval expected="45200" xpath="//flow/block[2]/block[4]/@bpda"/> | |||
<eval expected="6000" xpath="//flow/block[2]/block[4]/@left-offset"/> | |||
<eval expected="8000" xpath="//flow/block[2]/block[4]/@top-offset"/> | |||
<!-- cell 1.2 --> | |||
<!-- cell 2.2 --> | |||
<eval expected="93000" xpath="//flow/block[2]/block[5]/@ipd"/> | |||
<eval expected="107000" xpath="//flow/block[2]/block[5]/@ipda"/> | |||
<eval expected="28800" xpath="//flow/block[2]/block[5]/@bpd"/> |