xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r594852 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: fo/flow/table/EffRow.java fo/flow/table/FixedColRowGroupBuilder.java fo/flow/table/PrimaryGridUnit.java layoutmgr/table/TableRowIterator.java
Date Wed, 14 Nov 2007 12:21:55 GMT
Author: vhennebert
Date: Wed Nov 14 04:21:53 2007
New Revision: 594852

URL: http://svn.apache.org/viewvc?rev=594852&view=rev
Log:
Restored the setting of rowIndex on primary grid units (although testcases were already working...)

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EffRow.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EffRow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EffRow.java?rev=594852&r1=594851&r2=594852&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EffRow.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EffRow.java Wed Nov 14 04:21:53
2007
@@ -53,6 +53,13 @@
         this.index = index;
         this.bodyType = bodyType;
         this.gridUnits = gridUnits;
+        // TODO this is ugly, but we may eventually be able to do without that index
+        for (Iterator guIter = gridUnits.iterator(); guIter.hasNext();) {
+            Object gu = guIter.next();
+            if (gu instanceof PrimaryGridUnit) {
+                ((PrimaryGridUnit) gu).setStartRow(index);
+            }
+        }
     }
 
     /** @return the index of the EffRow in the sequence of rows */
@@ -126,19 +133,6 @@
             return (GridUnit)gridUnits.get(column);
         } else {
             return null;
-        }
-    }
-    
-    /**
-     * Sets a flag on all grid units of this effective row.
-     * @param flag which flag to set (on of the GridUnit.* constants)
-     * @param value new value for the flag
-     */
-    public void setFlagForAllGridUnits(int flag, boolean value) {
-        Iterator iter = gridUnits.iterator();
-        while (iter.hasNext()) {
-            GridUnit gu = (GridUnit)iter.next();
-            gu.setFlag(flag, value);
         }
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java?rev=594852&r1=594851&r2=594852&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
Wed Nov 14 04:21:53 2007
@@ -86,7 +86,7 @@
         }
         int columnIndex = cell.getColumnNumber() - 1;
         PrimaryGridUnit pgu = new PrimaryGridUnit(cell, currentTableRow,
-                table.getColumn(columnIndex), columnIndex, currentRowIndex);
+                table.getColumn(columnIndex), columnIndex);
         List row = (List) rows.get(currentRowIndex);
         row.set(columnIndex, pgu);
         // TODO

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java?rev=594852&r1=594851&r2=594852&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java Wed Nov
14 04:21:53 2007
@@ -54,9 +54,8 @@
      * @param startCol index of the column this grid unit belongs to, zero-based
      * @param startRow index of the row this grid unit belongs to, zero-based
      */
-    PrimaryGridUnit(TableCell cell, TableRow row, TableColumn column, int startCol, int startRow)
{
+    PrimaryGridUnit(TableCell cell, TableRow row, TableColumn column, int startCol) {
         super(cell, row, column, startCol, 0, 0);
-        this.startRow = startRow;
         log.trace("PrimaryGridUnit created, row " + startRow + " col " + startCol);
     }
 
@@ -179,6 +178,10 @@
             rows = new java.util.ArrayList();
         }
         rows.add(row);
+    }
+
+    void setStartRow(int startRow) {
+        this.startRow = startRow;
     }
 
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java?rev=594852&r1=594851&r2=594852&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java Wed
Nov 14 04:21:53 2007
@@ -52,6 +52,8 @@
 
     private Iterator rowGroupsIter;
 
+    private int rowIndex = 0;
+
     /**
      * Creates a new TableRowIterator.
      * @param table the table to iterate over
@@ -94,8 +96,7 @@
         int i = 0;
         for (Iterator rowIter = rowGroup.iterator(); rowIter.hasNext();) {
             List gridUnits = (List) rowIter.next();
-            effRowGroup[i] = new EffRow(i, tablePart, gridUnits);
-            i++;
+            effRowGroup[i++] = new EffRow(rowIndex++, tablePart, gridUnits);
         }
         return effRowGroup;
     }



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


Mime
View raw message