You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2007/11/05 17:07:50 UTC

svn commit: r592058 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/fo/flow/ test/fotree/unittests/table/ test/java/org/apache/fop/fo/flow/ test/java/org/apache/fop/layoutmgr/table/ test/layoutmgr/table/

Author: vhennebert
Date: Mon Nov  5 08:07:45 2007
New Revision: 592058

URL: http://svn.apache.org/viewvc?rev=592058&view=rev
Log:
First step towards building row groups at the FO tree stage. The built row groups are currently not used and the TableRowIterator stuff remains unchanged; this allows for more atomic commits.
- introduced RowGroupBuilder hierarchy;
- moved TableRowIterator test cases into fotree, and integrated them in the test suite.

Added:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FixedColRowGroupBuilder.java   (with props)
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RowGroupBuilder.java   (with props)
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/VariableColRowGroupBuilder.java   (with props)
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_simple.fo   (with props)
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_spans.fo   (with props)
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_simple.fo   (with props)
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_spans.fo   (with props)
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-row_simple.fo
      - copied unchanged from r585489, xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_no-row_simple.fo
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-row_spans.fo
      - copied unchanged from r585489, xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_no-row_spans.fo
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_simple.fo
      - copied unchanged from r585489, xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_simple.fo
    xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_spans.fo
      - copied unchanged from r585489, xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_spans.fo
    xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableRowIteratorTestCase.java
      - copied, changed from r585489, xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableRowIteratorTestCase.java
Removed:
    xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableRowIteratorTestCase.java
    xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_no-row_simple.fo
    xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_no-row_spans.fo
    xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_simple.fo
    xmlgraphics/fop/trunk/test/layoutmgr/table/TableRowIterator_spans.fo
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Table.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCellContainer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFooter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableHeader.java
    xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/AbstractTableTestCase.java
    xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FixedColRowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FixedColRowGroupBuilder.java?rev=592058&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FixedColRowGroupBuilder.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FixedColRowGroupBuilder.java Mon Nov  5 08:07:45 2007
@@ -0,0 +1,35 @@
+/*
+ * 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;
+
+
+/**
+ * A row group builder optimised for a fixed number of columns, known before the parsing
+ * of cells starts (that is, if the fo:table has explicit fo:table-column children).
+ */
+class FixedColRowGroupBuilder extends RowGroupBuilder {
+
+
+    FixedColRowGroupBuilder(Table t) {
+        super(t);
+        numberOfColumns = t.getNumberOfColumns();
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FixedColRowGroupBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FixedColRowGroupBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RowGroupBuilder.java?rev=592058&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RowGroupBuilder.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RowGroupBuilder.java Mon Nov  5 08:07:45 2007
@@ -0,0 +1,132 @@
+/*
+ * 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.ArrayList;
+import java.util.List;
+
+import org.apache.fop.layoutmgr.table.GridUnit;
+import org.apache.fop.layoutmgr.table.PrimaryGridUnit;
+
+/**
+ * A class that creates groups of rows belonging to a same set of spans. The first row of
+ * such a group has only cells which don't span over several rows, or whose spanning
+ * starts on this row. Similarly, the last row has only non-row spanning cells or spans
+ * which end on this row.
+ */
+abstract class RowGroupBuilder {
+
+    /** Number of columns in the corresponding table. */
+    protected int numberOfColumns;
+
+    /** 0-based, index in the row group. */
+    private int currentRowIndex;
+
+    private Table table;
+
+    /** The rows belonging to this row group. List of List of {@link GridUnit}s. */
+    protected List rows;
+
+    /**
+     * Creates and initialises a new builder for the given table.
+     * 
+     * @param t a table
+     */
+    protected RowGroupBuilder(Table t) {
+        table = t;
+        initialize();
+    }
+
+    /**
+     * Prepares this builder for creating a new row group.
+     */
+    private void initialize() {
+        rows = new ArrayList();
+        currentRowIndex = 0;
+    }
+
+    /**
+     * Adds a table-cell to the row-group, creating {@link GridUnit}s accordingly.
+     * 
+     * @param cell
+     */
+    void addTableCell(TableCell cell) {
+        for (int i = rows.size(); i < currentRowIndex + cell.getNumberRowsSpanned(); i++) {
+            List effRow = new ArrayList(numberOfColumns);
+            for (int j = 0; j < numberOfColumns; j++) {
+                effRow.add(null);
+            }
+            rows.add(effRow);
+        }
+        int columnIndex = cell.getColumnNumber() - 1;
+        PrimaryGridUnit pgu = new PrimaryGridUnit(cell, table.getColumn(columnIndex), columnIndex,
+                currentRowIndex);
+        List row = (List) rows.get(currentRowIndex);
+        row.set(columnIndex, pgu);
+        for (int j = 1; j < cell.getNumberColumnsSpanned(); j++) {
+            row.set(j + columnIndex,
+                    new GridUnit(pgu, table.getColumn(columnIndex + j), columnIndex + j, j));
+        }
+        for (int i = 1; i < cell.getNumberRowsSpanned(); i++) {
+            row = (List) rows.get(currentRowIndex + i);
+            for (int j = 0; j < cell.getNumberColumnsSpanned(); j++) {
+                row.set(j + columnIndex,
+                        new GridUnit(pgu, table.getColumn(columnIndex + j), columnIndex + j, j));
+            }
+        }
+        
+    }
+
+    /**
+     * Signals that a table row has just ended, potentially finishing the current row
+     * group.
+     * 
+     * @param body the table-body containing the row. Its
+     * {@link TableBody#addRowGroup(List)} method will be called if the current row group
+     * is finished.
+     */
+    void signalNewRow(TableBody body) {
+        if (currentRowIndex == rows.size() - 1) {
+            // Means that the current row has no cell spanning over following rows
+            body.addRowGroup(rows);
+            initialize();
+        } else {
+            currentRowIndex++;
+        }
+    }
+
+    /**
+     * Finishes and records the last row-group of the given table-body, if any. If there
+     * is no fo:table-row and the last cell of the table-body didn't have ends-row="true",
+     * then the {@link signalNewRow} method has not been called and the last row group has
+     * yet to be recorded.
+     * 
+     * @param tableBody
+     */
+    void finishLastRowGroup(TableBody tableBody) {
+        if (rows.size() > 0) {
+            tableBody.addRowGroup(rows);
+        }
+        // Reset, in case this rowGroupBuilder is re-used for other
+        // table-header/footer/body
+        initialize();
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RowGroupBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RowGroupBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Table.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Table.java?rev=592058&r1=592057&r2=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Table.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Table.java Mon Nov  5 08:07:45 2007
@@ -20,13 +20,13 @@
 package org.apache.fop.fo.flow;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.ValidationPercentBaseContext;
 import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.StaticPropertyList;
 import org.apache.fop.fo.ValidationException;
@@ -86,6 +86,7 @@
 
     private boolean hasExplicitColumns = false;
     private boolean columnsFinalized = false;
+    private RowGroupBuilder rowGroupBuilder;
 
     /**
      * The table's property list. Used in case the table has
@@ -226,6 +227,7 @@
                 }
             }
             this.propList = null;
+            rowGroupBuilder = null;
         }
         getFOEventHandler().endTable(this);
 
@@ -250,9 +252,15 @@
         case FO_TABLE_HEADER:
         case FO_TABLE_FOOTER:
         case FO_TABLE_BODY:
-            if (hasExplicitColumns && !columnsFinalized) {
+            if (!columnsFinalized) {
                 columnsFinalized = true;
-                finalizeColumns();
+                if (hasExplicitColumns) {
+                    finalizeColumns();
+                    rowGroupBuilder = new FixedColRowGroupBuilder(this);
+                } else {
+                    rowGroupBuilder = new VariableColRowGroupBuilder(this);
+                }
+                
             }
             switch (childId) {
             case FO_TABLE_FOOTER:
@@ -293,9 +301,36 @@
      * columns
      */
     void ensureColumnNumber(int columnNumber) throws FOPException {
+        assert !hasExplicitColumns;
         for (int i = columns.size() + 1; i <= columnNumber; i++) {
             columns.add(createImplicitColumn(i));
         }
+        ((VariableColRowGroupBuilder) rowGroupBuilder).ensureNumberOfColumns(columnNumber);
+        if (tableHeader != null) {
+            for (Iterator iter = tableHeader.getRowGroups().iterator(); iter.hasNext();) {
+                VariableColRowGroupBuilder.fillWithEmptyGridUnits((List) iter.next(),
+                        columnNumber); 
+            }
+        }
+        if (tableFooter != null) {
+            for (Iterator iter = tableFooter.getRowGroups().iterator(); iter.hasNext();) {
+                VariableColRowGroupBuilder.fillWithEmptyGridUnits((List) iter.next(),
+                        columnNumber); 
+            }
+        }
+        FONodeIterator bodyIter = getChildNodes();
+        if (bodyIter != null) {
+            while (bodyIter.hasNext()) {
+                FONode node = bodyIter.nextNode();
+                if (node instanceof TableBody) { // AFAIK, may be a marker
+                    for (Iterator iter = ((TableBody) node).getRowGroups().iterator();
+                            iter.hasNext();) {
+                        VariableColRowGroupBuilder.fillWithEmptyGridUnits((List) iter.next(),
+                                columnNumber); 
+                    }
+                }
+            }
+        }
     }
 
     private TableColumn createImplicitColumn(int colNumber)
@@ -499,18 +534,22 @@
      */
     public FONode clone(FONode parent, boolean removeChildren)
         throws FOPException {
-        FObj fobj = (FObj) super.clone(parent, removeChildren);
+        Table clone = (Table) super.clone(parent, removeChildren);
+        clone.columnsFinalized = false;
         if (removeChildren) {
-            Table t = (Table) fobj;
-            t.columns = new ArrayList();
-            t.tableHeader = null;
-            t.tableFooter = null;
+            clone.columns = new ArrayList();
+            clone.tableHeader = null;
+            clone.tableFooter = null;
         }
-        return fobj;
+        return clone;
     }
 
     /** {@inheritDoc} */
     public ColumnNumberManager getColumnNumberManager() {
         return columnNumberManager;
+    }
+
+    RowGroupBuilder getRowGroupBuilder() {
+        return rowGroupBuilder;
     }
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java?rev=592058&r1=592057&r2=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java Mon Nov  5 08:07:45 2007
@@ -20,6 +20,8 @@
 package org.apache.fop.fo.flow;
 
 import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
 
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
@@ -55,6 +57,8 @@
 
     private boolean rowsStarted = false;
 
+    private List rowGroups = new LinkedList();
+
     /**
      * @param parent FONode that is the parent of the object
      */
@@ -119,6 +123,8 @@
                         + "Expected: marker* (table-row+|table-cell+)");
                 getParent().removeChild(this);
             }
+        } else {
+            getTable().getRowGroupBuilder().finishLastRowGroup(this);
         }
     }
 
@@ -165,6 +171,7 @@
             case FO_TABLE_ROW:
                 if (rowsStarted) {
                     columnNumberManager.prepareForNextRow(pendingSpans);
+                    getTable().getRowGroupBuilder().signalNewRow(this);
                 }
                 rowsStarted = true;
                 break;
@@ -175,6 +182,7 @@
                 if (cell.endsRow()) {
                     firstRow = false;
                     columnNumberManager.prepareForNextRow(pendingSpans);
+                    getTable().getRowGroupBuilder().signalNewRow(this);
                 }
                 break;
             default:
@@ -184,6 +192,14 @@
         super.addChildNode(child);
     }
 
+    void addRowGroup(List rowGroup) {
+        rowGroups.add(rowGroup);
+    }
+
+    List getRowGroups() {
+        return rowGroups;
+    }
+
     /**
      * @return the Common Border, Padding, and Background Properties.
      */
@@ -218,6 +234,7 @@
             TableCell previousCell = (TableCell) getChildNodes().lastNode();
             if (!previousCell.endsRow()) {
                 columnNumberManager.prepareForNextRow(pendingSpans);
+                getTable().getRowGroupBuilder().signalNewRow(this);
             }
         }
         rowsStarted = true;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCellContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCellContainer.java?rev=592058&r1=592057&r2=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCellContainer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCellContainer.java Mon Nov  5 08:07:45 2007
@@ -95,6 +95,8 @@
         }
 
         columnNumberManager.signalUsedColumnNumbers(colNumber, colNumber + colSpan - 1);
+
+        t.getRowGroupBuilder().addTableCell(cell);
     }
 
     private void handleCellWidth(TableCell cell, int colNumber, int colSpan) throws FOPException {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFooter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFooter.java?rev=592058&r1=592057&r2=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFooter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFooter.java Mon Nov  5 08:07:45 2007
@@ -50,6 +50,8 @@
 //      getFOEventHandler().endFooter(this);
         if (!(tableRowsFound || tableCellsFound)) {
             missingChildElementError("marker* (table-row+|table-cell+)");
+        } else {
+            getTable().getRowGroupBuilder().finishLastRowGroup(this);
         }
 //      convertCellsToRows();
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableHeader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableHeader.java?rev=592058&r1=592057&r2=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableHeader.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableHeader.java Mon Nov  5 08:07:45 2007
@@ -50,6 +50,8 @@
 //      getFOEventHandler().endHeader(this);
         if (!(tableRowsFound || tableCellsFound)) {
             missingChildElementError("marker* (table-row+|table-cell+)");
+        } else {
+            getTable().getRowGroupBuilder().finishLastRowGroup(this);
         }
 //      convertCellsToRows();
     }

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/VariableColRowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/VariableColRowGroupBuilder.java?rev=592058&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/VariableColRowGroupBuilder.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/VariableColRowGroupBuilder.java Mon Nov  5 08:07:45 2007
@@ -0,0 +1,64 @@
+/*
+ * 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.List;
+
+import org.apache.fop.layoutmgr.table.EmptyGridUnit;
+
+/**
+ * A row group builder accommodating a variable number of columns. More flexible, but less
+ * efficient.
+ */
+class VariableColRowGroupBuilder extends RowGroupBuilder {
+
+    VariableColRowGroupBuilder(Table t) {
+        super(t);
+        numberOfColumns = 1;
+    }
+
+    /**
+     * Fills the given row group with empty grid units if necessary, so that it matches
+     * the given number of columns.
+     * 
+     * @param rowGroup a List of List of GridUnit
+     * @param numberOfColumns the number of columns that the row group must have
+     */
+    static void fillWithEmptyGridUnits(List rowGroup, int numberOfColumns) {
+        for (int i = 0; i < rowGroup.size(); i++) {
+            List effRow = (List) rowGroup.get(i);
+            for (int j = effRow.size(); j < numberOfColumns; j++) {
+                effRow.add(new EmptyGridUnit(null, null, null, j));
+            }
+        }
+    }
+
+    /**
+     * Updates the current row group to match the given number of columns, by adding empty
+     * grid units if necessary.
+     * 
+     * @param numberOfColumns new number of columns
+     */
+    void ensureNumberOfColumns(int numberOfColumns) {
+        this.numberOfColumns = numberOfColumns;
+        fillWithEmptyGridUnits(rows, numberOfColumns);
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/VariableColRowGroupBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/VariableColRowGroupBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_simple.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_simple.fo?rev=592058&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_simple.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_simple.fo Mon Nov  5 08:07:45 2007
@@ -0,0 +1,196 @@
+<?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$ -->
+<!--
+  WARNING: this file was semi-automatically generated from TableRowIterator_simple.fo and
+  contains the very same tables using starts-row/ends-row instead of fo:table-row objects.
+  Please modify TableRowIterator_simple.fo instead.
+-->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+  <fo:layout-master-set>
+    <fo:simple-page-master master-name="page" page-height="20cm" page-width="15cm"
+      margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
+      <fo:region-body/>
+    </fo:simple-page-master>
+  </fo:layout-master-set>
+  <fo:page-sequence master-reference="page" font-family="serif" font-size="14pt">
+    <fo:flow flow-name="xsl-region-body">
+      <!-- Table 1: no header, no footer, one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 2: no header, no footer, one body (2 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-body>
+          <fo:table-cell starts-row="true" ends-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 4</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 3: no header, no footer, two bodies (1 row, 1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+        </fo:table-body>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+          <fo:table-cell><fo:block>Cell 4</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 5</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 4: no header, no footer, two bodies (2 rows, 3 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell><fo:block>Cell 1.2</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 4</fo:block></fo:table-cell>
+        </fo:table-body>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 5</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 6</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 7</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 8</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 9</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 10</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 5: one header (1 row), no footer, one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+          <fo:table-cell starts-row="true"><fo:block>Header 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Header 2</fo:block></fo:table-cell>
+        </fo:table-header>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell><fo:block>Cell 1.2</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 6: no header, one footer (1 row), one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-footer>
+          <fo:table-cell starts-row="true"><fo:block>Footer 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Footer 2</fo:block></fo:table-cell>
+        </fo:table-footer>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell><fo:block>Cell 1.2</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 7: one header (1 row), one footer (1 row), one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+          <fo:table-cell starts-row="true"><fo:block>Header 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Header 2</fo:block></fo:table-cell>
+        </fo:table-header>
+        <fo:table-footer>
+          <fo:table-cell starts-row="true"><fo:block>Footer 1</fo:block></fo:table-cell>
+          <fo:table-cell><fo:block>Footer 1.2</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Footer 2</fo:block></fo:table-cell>
+        </fo:table-footer>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 8: one header (2 rows), one footer (3 rows), one body (2 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+          <fo:table-cell starts-row="true"><fo:block>Header 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Header 2</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Header 3</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Header 4</fo:block></fo:table-cell>
+        </fo:table-header>
+        <fo:table-footer>
+          <fo:table-cell starts-row="true"><fo:block>Footer 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Footer 2</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Footer 4</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Footer 5</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Footer 5</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Footer 6</fo:block></fo:table-cell>
+        </fo:table-footer>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 4</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+      <!-- Table 9: one header (3 rows), one footer (2 rows), three bodies (2 rows, 1 row, 3 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+        border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+          <fo:table-cell starts-row="true"><fo:block>Header 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Header 2</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Header 3</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Header 4</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Header 5</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Header 6</fo:block></fo:table-cell>
+        </fo:table-header>
+        <fo:table-footer>
+          <fo:table-cell starts-row="true"><fo:block>Footer 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Footer 2</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Footer 4</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Footer 5</fo:block></fo:table-cell>
+        </fo:table-footer>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 4</fo:block></fo:table-cell>
+        </fo:table-body>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 5</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 6</fo:block></fo:table-cell>
+        </fo:table-body>
+        <fo:table-body>
+          <fo:table-cell starts-row="true"><fo:block>Cell 7</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 8</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 9</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 10</fo:block></fo:table-cell>
+          <fo:table-cell starts-row="true"><fo:block>Cell 10</fo:block></fo:table-cell>
+          <fo:table-cell ends-row="true"><fo:block>Cell 11</fo:block></fo:table-cell>
+        </fo:table-body>
+      </fo:table>
+
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_simple.fo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_simple.fo
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_spans.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_spans.fo?rev=592058&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_spans.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_spans.fo Mon Nov  5 08:07:45 2007
@@ -0,0 +1,122 @@
+<?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$ -->
+<!--
+  WARNING: this file was semi-automatically generated from TableRowIterator_spans.fo and
+  contains the very same tables using starts-row/ends-row instead of fo:table-row objects.
+  Please modify TableRowIterator_spans.fo instead.
+-->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+  <fo:layout-master-set>
+    <fo:simple-page-master master-name="page" page-height="20cm" page-width="15cm"
+      margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
+      <fo:region-body/>
+    </fo:simple-page-master>
+  </fo:layout-master-set>
+  <fo:page-sequence master-reference="page" font-family="serif" font-size="14pt">
+    <fo:flow flow-name="xsl-region-body">
+      <!-- Table 1: no header, no footer, one body (1 row with column-span) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	    <fo:table-cell border="1pt solid" number-columns-spanned="2" starts-row="true" ends-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 2: no header, no footer, one body (1 row-group of 2 rows) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Cell 4</fo:block></fo:table-cell>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 3: no header, no footer, one body (1 row-group of 2 rows, 1 row) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Cell 4</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 6</fo:block></fo:table-cell>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 4: no header, no footer, one body (1 row, 1 row-group of 2 rows) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Cell 7</fo:block></fo:table-cell>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 5: no header, no footer, one body (1 row, 1 row-group of 3 rows, 1 row) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" ends-row="true"><fo:block>Cell 4</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true" ends-row="true"><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Cell 8</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 9</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 10</fo:block></fo:table-cell>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 6: one header (1 row-group of 2 rows), one footer (1 row, 1 row-group of 3 rows),
+           one body (1 row-group of 2 rows, 1 row, 1 row-group of 3 rows) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true"><fo:block>Header 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Header 2</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Header 4</fo:block></fo:table-cell>
+        </fo:table-header>
+        <fo:table-footer>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Footer 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Footer 2</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true"><fo:block>Footer 3</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Footer 4</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true" ends-row="true"><fo:block>Footer 6</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Footer 7</fo:block></fo:table-cell>
+        </fo:table-footer>
+	<fo:table-body>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" ends-row="true"><fo:block>Cell 2</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" ends-row="true"><fo:block>Cell 6</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true"><fo:block>Cell 7</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" ends-row="true"><fo:block>Cell 8</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2" starts-row="true" ends-row="true"><fo:block>Cell 9</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" starts-row="true" ends-row="true"><fo:block>Cell 10</fo:block></fo:table-cell>
+	</fo:table-body>
+      </fo:table>
+
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_spans.fo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_no-row_spans.fo
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_simple.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_simple.fo?rev=592058&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_simple.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_simple.fo Mon Nov  5 08:07:45 2007
@@ -0,0 +1,257 @@
+<?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="20cm" page-width="15cm"
+      margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
+      <fo:region-body/>
+    </fo:simple-page-master>
+  </fo:layout-master-set>
+  <fo:page-sequence master-reference="page" font-family="serif" font-size="14pt">
+    <fo:flow flow-name="xsl-region-body">
+      <!-- Table 1: no header, no footer, one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 2: no header, no footer, one body (2 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 3: no header, no footer, two bodies (1 row, 1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 4: no header, no footer, two bodies (2 rows, 3 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 6</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 7</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 8</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 9</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 10</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 5: one header (1 row), no footer, one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Header 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Header 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-header>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 6: no header, one footer (1 row), one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+        <fo:table-footer>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Footer 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Footer 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-footer>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 7: one header (1 row), one footer (1 row), one body (1 row) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Header 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Header 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-header>
+        <fo:table-footer>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Footer 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Footer 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-footer>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 8: one header (2 rows), one footer (3 rows), one body (2 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Header 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Header 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Header 3</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Header 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-header>
+        <fo:table-footer>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Footer 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Footer 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Footer 4</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Footer 5</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Footer 5</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Footer 6</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-footer>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 9: one header (3 rows), one footer (2 rows), three bodies (2 rows, 1 row, 3 rows) -->
+      <fo:table width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Header 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Header 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Header 3</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Header 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Header 5</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Header 6</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-header>
+        <fo:table-footer>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Footer 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Footer 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Footer 4</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Footer 5</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-footer>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 6</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 7</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 8</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 9</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 10</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell><fo:block>Cell 10</fo:block></fo:table-cell>
+	    <fo:table-cell><fo:block>Cell 11</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_simple.fo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_simple.fo
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_spans.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_spans.fo?rev=592058&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_spans.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_spans.fo Mon Nov  5 08:07:45 2007
@@ -0,0 +1,169 @@
+<?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="20cm" page-width="15cm"
+      margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
+      <fo:region-body/>
+    </fo:simple-page-master>
+  </fo:layout-master-set>
+  <fo:page-sequence master-reference="page" font-family="serif" font-size="14pt">
+    <fo:flow flow-name="xsl-region-body">
+      <!-- Table 1: no header, no footer, one body (1 row with column-span) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-columns-spanned="2"><fo:block>Cell 1</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 2: no header, no footer, one body (1 row-group of 2 rows) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 3: no header, no footer, one body (1 row-group of 2 rows, 1 row) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 6</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 4: no header, no footer, one body (1 row, 1 row-group of 2 rows) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 5</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 7</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 5: no header, no footer, one body (1 row, 1 row-group of 3 rows, 1 row) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 3</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 5</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 8</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 9</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 10</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+      <!-- Table 6: one header (1 row-group of 2 rows), one footer (1 row, 1 row-group of 3 rows),
+           one body (1 row-group of 2 rows, 1 row, 1 row-group of 3 rows) -->
+      <fo:table border-separation="2pt" width="10cm" space-before="12pt" table-layout="fixed"
+	border-collapse="separate" border="1pt solid black">
+        <fo:table-header>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Header 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Header 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Header 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-header>
+        <fo:table-footer>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Footer 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Footer 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Footer 3</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Footer 4</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Footer 6</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Footer 7</fo:block></fo:table-cell>
+	  </fo:table-row>
+        </fo:table-footer>
+	<fo:table-body>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 1</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 2</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 3</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 5</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 6</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 7</fo:block></fo:table-cell>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 8</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid" number-rows-spanned="2"><fo:block>Cell 9</fo:block></fo:table-cell>
+	  </fo:table-row>
+	  <fo:table-row>
+	    <fo:table-cell border="1pt solid"><fo:block>Cell 10</fo:block></fo:table-cell>
+	  </fo:table-row>
+	</fo:table-body>
+      </fo:table>
+
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_spans.fo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/TableRowIterator_no-col_spans.fo
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/AbstractTableTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/AbstractTableTestCase.java?rev=592058&r1=592057&r2=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/AbstractTableTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/AbstractTableTestCase.java Mon Nov  5 08:07:45 2007
@@ -19,6 +19,8 @@
 
 package org.apache.fop.fo.flow;
 
+import java.util.Iterator;
+
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fotreetest.FOTreeUnitTester;
@@ -48,5 +50,9 @@
 
     protected TableHandler getTableHandler() {
         return tableHandler;
+    }
+
+    protected Iterator getTableIterator() {
+        return tableHandler.getTables().iterator();
     }
 }

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java?rev=592058&r1=592057&r2=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableColumnColumnNumberTestCase.java Mon Nov  5 08:07:45 2007
@@ -63,7 +63,7 @@
 
     public void testColumnNumber() throws Exception {
         setUp("table/table-column_column-number.fo");
-        Iterator tableIter = getTableHandler().getTables().iterator();
+        Iterator tableIter = getTableIterator();
         Table t = (Table) tableIter.next();
         assertEquals(2, t.getNumberOfColumns());
         checkColumn(t, 1, false, 1, 2, 100000);
@@ -100,7 +100,7 @@
     public void testImplicitColumns() throws Exception {
         setUp("table/implicit_columns_column-number.fo");
         percentBaseContext.setUnitaryWidth(100000);
-        Iterator tableIter = getTableHandler().getTables().iterator();
+        Iterator tableIter = getTableIterator();
 
         checkImplicitColumns(tableIter, 2);
         checkImplicitColumns(tableIter, 2);

Copied: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableRowIteratorTestCase.java (from r585489, xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableRowIteratorTestCase.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableRowIteratorTestCase.java?p2=xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableRowIteratorTestCase.java&p1=xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableRowIteratorTestCase.java&r1=585489&r2=592058&rev=592058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableRowIteratorTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/TableRowIteratorTestCase.java Mon Nov  5 08:07:45 2007
@@ -17,63 +17,19 @@
 
 /* $Id$ */
 
-package org.apache.fop.layoutmgr.table;
+package org.apache.fop.fo.flow;
 
-import java.io.File;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 
-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.flow.Table;
-import org.xml.sax.XMLReader;
-
 /**
  * Tests that TableRowIterator returns, for each part of a table, the expected number of
  * row-groups with the expected number or rows in each.
  */
-public class TableRowIteratorTestCase extends TestCase {
-
-    private XMLReader foReader;
-
-    private TableHandler tableHandler;
-
-    /** Returns Table instances. */
-    private Iterator tableIterator;
+public class TableRowIteratorTestCase extends AbstractTableTestCase {
 
-    /** Returns ColumnSetup instances. */
-    private Iterator columnSetupIterator;
-
-    /**
-     * Creates the SAX parser for the FO file and a FO user agent with an overriden
-     * FOEventHandler and sets them up.
-     */
-    public void setUp() throws Exception {
-        SAXParserFactory spf = SAXParserFactory.newInstance();
-        spf.setNamespaceAware(true);
-        spf.setValidating(false);
-        SAXParser parser;
-        parser = spf.newSAXParser();
-        foReader = parser.getXMLReader();
-
-        FopFactory fopFactory = FopFactory.newInstance(); 
-        FOUserAgent ua = fopFactory.newFOUserAgent();
-        tableHandler = new TableHandler(ua);
-        ua.setFOEventHandlerOverride(tableHandler);
-
-        Fop fop = fopFactory.newFop(ua);
-
-        foReader.setContentHandler(fop.getDefaultHandler());
-        foReader.setDTDHandler(fop.getDefaultHandler());
-        foReader.setErrorHandler(fop.getDefaultHandler());
-        foReader.setEntityResolver(fop.getDefaultHandler());
+    public TableRowIteratorTestCase() throws Exception {
+        super();
     }
 
     /**
@@ -82,16 +38,16 @@
      * @param filename basename of a test FO file
      * @throws Exception
      */
-    private void setUp(String filename) throws Exception {
-        foReader.parse(new File("test/layoutmgr/table/" + filename).toURL().toExternalForm());
-        List tables = tableHandler.getTables();
-        List columnSetups = new LinkedList();
-        tableIterator = tables.iterator();
-        for (Iterator i = tables.iterator(); i.hasNext();) {
-            columnSetups.add(new ColumnSetup((Table) i.next()));
-        }
-        columnSetupIterator = columnSetups.iterator();
-    }
+//    private void setUp(String filename) throws Exception {
+//        foReader.parse(new File("test/layoutmgr/table/" + filename).toURL().toExternalForm());
+//        List tables = tableHandler.getTables();
+//        List columnSetups = new LinkedList();
+//        tableIterator = tables.iterator();
+//        for (Iterator i = tables.iterator(); i.hasNext();) {
+//            columnSetups.add(new ColumnSetup((Table) i.next()));
+//        }
+//        columnSetupIterator = columnSetups.iterator();
+//    }
 
     /**
      * Checks that the given iterator will return row groups as expected. More precisely,
@@ -103,107 +59,143 @@
      * @param expectedRowLengths expected lengths of all the row groups of this part of
      * the table
      */
-    private void checkTablePartRowGroups(TableRowIterator tri, int[] expectedRowLengths) {
+    private void checkTablePartRowGroups(TableBody body, int[] expectedRowLengths) {
+        Iterator rowGroupIter = body.getRowGroups().iterator();
         for (int i = 0; i < expectedRowLengths.length; i++) {
-            EffRow[] row = tri.getNextRowGroup();
-            assertTrue(row.length == expectedRowLengths[i]);
+            assertTrue(rowGroupIter.hasNext());
+            List rowGroup = (List) rowGroupIter.next();
+            assertEquals(expectedRowLengths[i], rowGroup.size());
         }
-        assertNull(tri.getNextRowGroup());        
+        assertFalse(rowGroupIter.hasNext());
     }
 
     /**
      * Gets the next table and checks its row-groups.
-     * 
+     * @param tableIter TODO
      * @param expectedHeaderRowLengths expected row-group sizes for the header. If null
      * the table is not expected to have a header
      * @param expectedFooterRowLengths expected row-group sizes for the footer. If null
      * the table is not expected to have a footer
      * @param expectedBodyRowLengths expected row-group sizes for the body(-ies)
      */
-    private void checkNextTableRowGroups(int[] expectedHeaderRowLengths,
-            int[] expectedFooterRowLengths, int[] expectedBodyRowLengths) {
-        Table table = (Table) tableIterator.next();
-        ColumnSetup columnSetup = (ColumnSetup) columnSetupIterator.next();
-        TableRowIterator tri;
-        if (expectedHeaderRowLengths != null) {
-            tri = new TableRowIterator(table, columnSetup, TableRowIterator.HEADER);
-            checkTablePartRowGroups(tri, expectedHeaderRowLengths);
+    private void checkNextTableRowGroups(Iterator tableIter,
+            int[] expectedHeaderRowLengths, int[] expectedFooterRowLengths, int[][] expectedBodyRowLengths) {
+        Table table = (Table) tableIter.next();
+        if (expectedHeaderRowLengths == null) {
+            assertNull(table.getTableHeader());
+        } else {
+            checkTablePartRowGroups(table.getTableHeader(), expectedHeaderRowLengths);
+        }
+        if (expectedFooterRowLengths == null) {
+            assertNull(table.getTableFooter());
+        } else {
+            checkTablePartRowGroups(table.getTableFooter(), expectedFooterRowLengths);
         }
-        if (expectedFooterRowLengths != null) {
-            tri = new TableRowIterator(table, columnSetup, TableRowIterator.FOOTER);
-            checkTablePartRowGroups(tri, expectedFooterRowLengths);
+        Iterator bodyIter = table.getChildNodes();
+        for (int i = 0; i < expectedBodyRowLengths.length; i++) {
+            assertTrue(bodyIter.hasNext());
+            checkTablePartRowGroups((TableBody) bodyIter.next(), expectedBodyRowLengths[i]);
         }
-        tri = new TableRowIterator(table, columnSetup, TableRowIterator.BODY);
-        checkTablePartRowGroups(tri, expectedBodyRowLengths);
+
+//        ColumnSetup columnSetup = (ColumnSetup) columnSetupIterator.next();
+//        TableRowIterator tri;
+//        if (expectedHeaderRowLengths != null) {
+//            tri = new TableRowIterator(table, columnSetup, TableRowIterator.HEADER);
+//            checkTablePartRowGroups(tri, expectedHeaderRowLengths);
+//        }
+//        if (expectedFooterRowLengths != null) {
+//            tri = new TableRowIterator(table, columnSetup, TableRowIterator.FOOTER);
+//            checkTablePartRowGroups(tri, expectedFooterRowLengths);
+//        }
+//        tri = new TableRowIterator(table, columnSetup, TableRowIterator.BODY);
+//        checkTablePartRowGroups(tri, expectedBodyRowLengths);
     }
 
     public void checkSimple(String filename) throws Exception {
         setUp(filename);
+        Iterator tableIter = getTableIterator();
 
         // Table 1: no header, no footer, one body (1 row)
-        checkNextTableRowGroups(null, null, new int[] {1});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{1}});
 
         // Table 2: no header, no footer, one body (2 rows)
-        checkNextTableRowGroups(null, null, new int[] {1, 1});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{1, 1}});
 
         // Table 3: no header, no footer, two bodies (1 row, 1 row)
-        checkNextTableRowGroups(null, null, new int[] {1, 1});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{1}, {1}});
 
         // Table 4: no header, no footer, two bodies (2 rows, 3 rows)
-        checkNextTableRowGroups(null, null, new int[] {1, 1, 1, 1, 1});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{1, 1}, {1, 1, 1}});
 
         // Table 5: one header (1 row), no footer, one body (1 row)
-        checkNextTableRowGroups(new int[] {1}, null, new int[] {1});
+        checkNextTableRowGroups(tableIter, new int[] {1}, null, new int[][] {{1}});
 
         // Table 6: no header, one footer (1 row), one body (1 row)
-        checkNextTableRowGroups(null, new int[] {1}, new int[] {1});
+        checkNextTableRowGroups(tableIter, null, new int[] {1}, new int[][] {{1}});
 
         // Table 7: one header (1 row), one footer (1 row), one body (1 row)
-        checkNextTableRowGroups(new int[] {1}, new int[] {1}, new int[] {1});
+        checkNextTableRowGroups(tableIter, new int[] {1}, new int[] {1}, new int[][] {{1}});
 
         // Table 8: one header (2 rows), one footer (3 rows), one body (2 rows)
-        checkNextTableRowGroups(new int[] {1, 1}, new int[] {1, 1, 1}, new int[] {1, 1});
+        checkNextTableRowGroups(tableIter, new int[] {1, 1}, new int[] {1, 1, 1}, new int[][] {{1, 1}});
 
         // Table 9: one header (3 rows), one footer (2 rows), three bodies (2 rows, 1 row, 3 rows)
-        checkNextTableRowGroups(new int[] {1, 1, 1}, new int[] {1, 1}, new int[] {1, 1, 1, 1, 1, 1});
+        checkNextTableRowGroups(tableIter, new int[] {1, 1, 1}, new int[] {1, 1}, new int[][] {{1, 1}, {1}, {1, 1, 1}});
     }
 
     public void checkSpans(String filename) throws Exception {
         setUp(filename);
+        Iterator tableIter = getTableIterator();
 
         // Table 1: no header, no footer, one body (1 row with column-span)
-        checkNextTableRowGroups(null, null, new int[] {1});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{1}});
 
         // Table 2: no header, no footer, one body (1 row-group of 2 rows)
-        checkNextTableRowGroups(null, null, new int[] {2});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{2}});
 
         // Table 3: no header, no footer, one body (1 row-group of 2 rows, 1 row) 
-        checkNextTableRowGroups(null, null, new int[] {2, 1});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{2, 1}});
 
         // Table 4: no header, no footer, one body (1 row, 1 row-group of 2 rows)
-        checkNextTableRowGroups(null, null, new int[] {1, 2});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{1, 2}});
 
         // Table 5: no header, no footer, one body (1 row, 1 row-group of 3 rows, 1 row) 
-        checkNextTableRowGroups(null, null, new int[] {1, 3, 1});
+        checkNextTableRowGroups(tableIter, null, null, new int[][] {{1, 3, 1}});
 
         // Table 6: one header (1 row-group of 2 rows), one footer (1 row, 1 row-group of 3 rows),
         // one body (1 row-group of 2 rows, 1 row, 1 row-group of 3 rows) 
-        checkNextTableRowGroups(new int[] {2}, new int[] {1, 3}, new int[] {2, 1, 3});
+        checkNextTableRowGroups(tableIter, new int[] {2}, new int[] {1, 3}, new int[][] {{2, 1, 3}});
     }
 
     public void testWithRowsSimple() throws Exception {
-        checkSimple("TableRowIterator_simple.fo");
+        checkSimple("table/TableRowIterator_simple.fo");
     }
 
     public void testWithRowsSpans() throws Exception {
-        checkSpans("TableRowIterator_spans.fo");
+        checkSpans("table/TableRowIterator_spans.fo");
     }
 
     public void testNoRowSimple() throws Exception {
-        checkSimple("TableRowIterator_no-row_simple.fo");
+        checkSimple("table/TableRowIterator_no-row_simple.fo");
     }
 
     public void testNoRowSpans() throws Exception {
-        checkSpans("TableRowIterator_no-row_spans.fo");
+        checkSpans("table/TableRowIterator_no-row_spans.fo");
+    }
+
+    public void testNoColWithRowsSimple() throws Exception {
+        checkSimple("table/TableRowIterator_no-col_simple.fo");
+    }
+
+    public void testNoColWithRowsSpans() throws Exception {
+        checkSpans("table/TableRowIterator_no-col_spans.fo");
+    }
+
+    public void testNoColNoRowSimple() throws Exception {
+        checkSimple("table/TableRowIterator_no-col_no-row_simple.fo");
+    }
+
+    public void testNoColNoRowSpans() throws Exception {
+        checkSpans("table/TableRowIterator_no-col_no-row_spans.fo");
     }
-}
\ No newline at end of file
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org