xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adelme...@apache.org
Subject svn commit: r429689 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table: TableContentLayoutManager.java TableStepper.java
Date Tue, 08 Aug 2006 15:26:55 GMT
Author: adelmelle
Date: Tue Aug  8 08:26:54 2006
New Revision: 429689

URL: http://svn.apache.org/viewvc?rev=429689&view=rev
Log:
Small update in the table-layout code

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java?rev=429689&r1=429688&r2=429689&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
Tue Aug  8 08:26:54 2006
@@ -76,7 +76,7 @@
 
     private int startXOffset;
     private int usedBPD;
-    
+        
     /**
      * Main constructor
      * @param parent Parent layout manager
@@ -144,15 +144,18 @@
             this.headerList = getKnuthElementsForRowIterator(
                     headerIter, context, alignment, TableRowIterator.HEADER);
             ElementListUtils.removeLegalBreaks(this.headerList);
-            this.headerNetHeight = ElementListUtils.calcContentLength(this.headerList);
+            this.headerNetHeight = 
+                ElementListUtils.calcContentLength(this.headerList);
             if (log.isDebugEnabled()) {
-                log.debug("==> Header: " + headerNetHeight + " - " + this.headerList);
+                log.debug("==> Header: " 
+                        + headerNetHeight + " - " + this.headerList);
             }
             TableHeaderFooterPosition pos = new TableHeaderFooterPosition(
                     getTableLM(), true, this.headerList);
             KnuthBox box = new KnuthBox(headerNetHeight, pos, false);
             if (getTableLM().getTable().omitHeaderAtBreak()) {
-                //We can simply add the table header at the beginning of the whole list
+                //We can simply add the table header at the start 
+                //of the whole list
                 headerAsFirst = box;
             } else {
                 headerAsSecondToLast = box;
@@ -162,17 +165,17 @@
             this.footerList = getKnuthElementsForRowIterator(
                     footerIter, context, alignment, TableRowIterator.FOOTER);
             ElementListUtils.removeLegalBreaks(this.footerList);
-            this.footerNetHeight = ElementListUtils.calcContentLength(this.footerList);
+            this.footerNetHeight = 
+                    ElementListUtils.calcContentLength(this.footerList);
             if (log.isDebugEnabled()) {
-                log.debug("==> Footer: " + footerNetHeight + " - " + this.footerList);
-            }
-            if (true /*getTableLM().getTable().omitFooterAtBreak()*/) {
-                //We can simply add the table header at the end of the whole list
-                TableHeaderFooterPosition pos = new TableHeaderFooterPosition(
-                        getTableLM(), false, this.footerList);
-                KnuthBox box = new KnuthBox(footerNetHeight, pos, false);
-                footerAsLast = box;
+                log.debug("==> Footer: " 
+                        + footerNetHeight + " - " + this.footerList);
             }
+            //We can simply add the table footer at the end of the whole list
+            TableHeaderFooterPosition pos = new TableHeaderFooterPosition(
+                    getTableLM(), false, this.footerList);
+            KnuthBox box = new KnuthBox(footerNetHeight, pos, false);
+            footerAsLast = box;
         }
         LinkedList returnList = getKnuthElementsForRowIterator(
                 trIter, context, alignment, TableRowIterator.BODY);
@@ -192,7 +195,8 @@
      * @param iter TableRowIterator instance to fetch rows from
      * @param context Active LayoutContext
      * @param alignment alignment indicator
-     * @param bodyType Indicates what kind of body is being processed (BODY, HEADER or FOOTER)
+     * @param bodyType Indicates what kind of body is being processed 
+     *                  (BODY, HEADER or FOOTER)
      * @return An element list
      */
     private LinkedList getKnuthElementsForRowIterator(TableRowIterator iter, 
@@ -211,7 +215,7 @@
                         pen.setP(-KnuthPenalty.INFINITE);
                         pen.setBreakClass(rowFO.getBreakBefore());
                     } else if (last instanceof BreakElement) {
-                        BreakElement breakPoss = (BreakElement)last;
+                        BreakElement breakPoss = (BreakElement) last;
                         breakPoss.setPenaltyValue(-KnuthPenalty.INFINITE);
                         breakPoss.setBreakClass(rowFO.getBreakBefore());
                     }
@@ -573,7 +577,6 @@
                 log.debug("  height=" + rowHeights[i] + " explicit=" + explicitRowHeights[i]);
             }
         }
-        //TODO It may make sense to reuse the stepper since it allocates quite some space
         TableStepper stepper = new TableStepper(this);
         LinkedList returnedList = stepper.getCombinedKnuthElementsForRowGroup(
                 context, rowGroup, maxColumnCount, bodyType);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?rev=429689&r1=429688&r2=429689&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Tue Aug
 8 08:26:54 2006
@@ -72,10 +72,10 @@
      */
     public TableStepper(TableContentLayoutManager tclm) {
         this.tclm = tclm;
-        this.activeRow = 0;
     }
     
     private void setup(int columnCount) {
+        this.activeRow = 0;
         elementLists = new List[columnCount];
         startRow = new int[columnCount];
         start = new int[columnCount];



---------------------------------------------------------------------
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