]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Renamed firstRow into firstRowIndex and moved its initialization into handeTableConte...
authorVincent Hennebert <vhennebert@apache.org>
Tue, 18 Dec 2007 17:01:45 +0000 (17:01 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Tue, 18 Dec 2007 17:01:45 +0000 (17:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@605253 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/table/RowPainter.java

index d053c6ebd5328c11a6b0fa3ca31bb8f9b9756043..490f999cd0f5be213f3b705d82113bc68add416d 100644 (file)
@@ -50,7 +50,7 @@ class RowPainter {
     /**
      * Index of the first row of the current part present on the current page.
      */
-    private int firstRow;
+    private int firstRowIndex;
     /**
      * Keeps track of the y-offsets of each row on a page.
      * This is particularly needed for spanned cells where you need to know the y-offset
@@ -86,7 +86,7 @@ class RowPainter {
         this.start = new int[colCount];
         this.end = new int[colCount];
         this.partBPD = new int[colCount];
-        this.firstRow = -1;
+        this.firstRowIndex = -1;
         Arrays.fill(end, -1);
     }
 
@@ -109,6 +109,9 @@ class RowPainter {
         }
         rowFO = tcpos.row.getTableRow();
         lastRow = tcpos.row;
+        if (firstRowIndex < 0) {
+            firstRowIndex = lastRow.getIndex();
+        }
         Iterator partIter = tcpos.cellParts.iterator();
         //Iterate over all grid units in the current step
         while (partIter.hasNext()) {
@@ -289,7 +292,7 @@ class RowPainter {
             len += pgu.getHalfMaxBeforeBorderWidth();
             len += pgu.getHalfMaxAfterBorderWidth();
         }
-        int startRow = Math.max(pgu.getStartRow(), firstRow);
+        int startRow = Math.max(pgu.getStartRow(), firstRowIndex);
         Integer storedOffset = (Integer)rowOffsets.get(new Integer(startRow));
         int effYOffset;
         if (storedOffset != null) {
@@ -303,11 +306,8 @@ class RowPainter {
 
     private void addAreasForCell(PrimaryGridUnit pgu, int startPos, int endPos,
             EffRow row, int contentHeight, int rowHeight) {
-        if (firstRow < 0) {
-            firstRow = row.getIndex();
-        }
         //Determine the first row in this sequence
-        int startRowIndex = Math.max(pgu.getStartRow(), firstRow);
+        int startRowIndex = Math.max(pgu.getStartRow(), firstRowIndex);
         int lastRowIndex = lastRow.getIndex();
 
         // In collapsing-border model, if the cell spans over several columns/rows then
@@ -362,7 +362,7 @@ class RowPainter {
     }
 
     void endPart() {
-        firstRow = -1;
+        firstRowIndex = -1;
         rowOffsets.clear();
     }
 }