]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Removed the no longer needed maxColumnCount parameter
authorVincent Hennebert <vhennebert@apache.org>
Thu, 24 Jan 2008 11:32:07 +0000 (11:32 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Thu, 24 Jan 2008 11:32:07 +0000 (11:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@614845 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
src/java/org/apache/fop/layoutmgr/table/TableStepper.java

index 199af0fc1470bfdb3c95fbea86ba9b901b4c094b..9364d2fba935c323892ec43f04eebf3acfa24d82 100644 (file)
@@ -136,7 +136,6 @@ class RowGroupLayoutManager {
         MinOptMax[] rowHeights = new MinOptMax[rowGroup.length];
         MinOptMax[] explicitRowHeights = new MinOptMax[rowGroup.length];
         EffRow row;
-        int maxColumnCount = 0;
         List pgus = new java.util.ArrayList(); //holds a list of a row's primary grid units
         for (int rgi = 0; rgi < rowGroup.length; rgi++) {
             row = rowGroup[rgi];
@@ -151,8 +150,6 @@ class RowGroupLayoutManager {
             // The BPD of the biggest cell in the row
             int maxCellBPD = 0;
             for (int j = 0; j < row.getGridUnits().size(); j++) {
-                assert maxColumnCount == 0 || maxColumnCount == row.getGridUnits().size();
-                maxColumnCount = Math.max(maxColumnCount, row.getGridUnits().size());
                 GridUnit gu = row.getGridUnit(j);
                 if ((gu.isPrimary() || (gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan())) 
                         && !gu.isEmpty()) {
@@ -281,8 +278,8 @@ class RowGroupLayoutManager {
                 log.debug("  height=" + rowHeights[i] + " explicit=" + explicitRowHeights[i]);
             }
         }
-        LinkedList returnedList = tableStepper.getCombinedKnuthElementsForRowGroup(
-                context, rowGroup, maxColumnCount, bodyType);
+        LinkedList returnedList = tableStepper.getCombinedKnuthElementsForRowGroup(context,
+                rowGroup, bodyType);
         if (returnedList != null) {
             returnList.addAll(returnedList);
         }
index 344c90e07446ae7aa8ca909bebe651d7a5024609..3455e8a32726843808a9d1c92bff5fba8afb368a 100644 (file)
@@ -69,7 +69,7 @@ public class TableContentLayoutManager implements PercentBaseContext {
     private int startXOffset;
     private int usedBPD;
     
-    private TableStepper stepper = new TableStepper(this);
+    private TableStepper stepper;
         
     /**
      * Main constructor
@@ -85,6 +85,7 @@ public class TableContentLayoutManager implements PercentBaseContext {
         if (table.getTableFooter() != null) {
             footerIter = new TableRowIterator(table, TableRowIterator.FOOTER);
         }
+        stepper = new TableStepper(this);
     }
     
     /**
index 1d9f95ca1e2ae37b921bb1ba3f6531e153877b21..3e038604a4c10ab6bdf4baeb4eb647a2aa45d08c 100644 (file)
@@ -65,15 +65,16 @@ public class TableStepper {
      */
     public TableStepper(TableContentLayoutManager tclm) {
         this.tclm = tclm;
+        this.columnCount = tclm.getTableLM().getTable().getNumberOfColumns();
     }
 
     /**
      * Initializes the fields of this instance to handle a new row group.
      * 
-     * @param columnCount number of columns the row group has 
+     * @param rowGroup the new row group to handle
      */
-    private void setup(int columnCount) {
-        this.columnCount = columnCount;
+    private void setup(EffRow[] rowGroup) {
+        this.rowGroup = rowGroup;
         this.activeRowIndex = 0;
         this.previousRowsLength = 0;
     }
@@ -143,15 +144,12 @@ public class TableStepper {
      * Creates the combined element list for a row group.
      * @param context Active LayoutContext
      * @param rowGroup the row group
-     * @param maxColumnCount the maximum number of columns to expect
      * @param bodyType Indicates what type of body is processed (body, header or footer)
      * @return the combined element list
      */
-    public LinkedList getCombinedKnuthElementsForRowGroup(
-            LayoutContext context,
-            EffRow[] rowGroup, int maxColumnCount, int bodyType) {
-        this.rowGroup = rowGroup;
-        setup(maxColumnCount);
+    public LinkedList getCombinedKnuthElementsForRowGroup(LayoutContext context, EffRow[] rowGroup,
+            int bodyType) {
+        setup(rowGroup);
         initializeElementLists();
         calcTotalHeight();
 
@@ -171,7 +169,7 @@ public class TableStepper {
             boolean forcedBreak = false;
             int breakClass = -1;
             //Put all involved grid units into a list
-            List cellParts = new java.util.ArrayList(maxColumnCount);
+            List cellParts = new java.util.ArrayList(columnCount);
             for (Iterator iter = activeCells.iterator(); iter.hasNext();) {
                 ActiveCell activeCell = (ActiveCell) iter.next();
                 CellPart part = activeCell.createCellPart();