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 2008/02/26 17:23:16 UTC

svn commit: r631276 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: fo/flow/table/EmptyGridUnit.java fo/flow/table/GridUnit.java fo/flow/table/PrimaryGridUnit.java layoutmgr/table/TableContentLayoutManager.java

Author: vhennebert
Date: Tue Feb 26 08:23:15 2008
New Revision: 631276

URL: http://svn.apache.org/viewvc?rev=631276&view=rev
Log:
Moved the getBody method into PrimaryGridUnit, since it's only needed there and that allows to simplify EmptyGridUnit

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/GridUnit.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java?rev=631276&r1=631275&r2=631276&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java Tue Feb 26 08:23:15 2008
@@ -25,8 +25,6 @@
  */
 public class EmptyGridUnit extends GridUnit {
 
-    private TableBody body;
-
     /**
      * @param table the containing table
      * @param row the table-row element this grid unit belongs to (if any)
@@ -54,11 +52,6 @@
     /** {@inheritDoc} */
     public boolean isPrimary() {
         return false;
-    }
-
-    /** {@inheritDoc} */
-    public TableBody getBody() {
-        return this.body;
     }
 
     /** {@inheritDoc} */

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/GridUnit.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/GridUnit.java?rev=631276&r1=631275&r2=631276&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/GridUnit.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/GridUnit.java Tue Feb 26 08:23:15 2008
@@ -19,7 +19,6 @@
 
 package org.apache.fop.fo.flow.table;
 
-import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground.BorderInfo;
 import org.apache.fop.layoutmgr.table.CollapsingBorderModel;
@@ -163,14 +162,6 @@
 
     void setRow(TableRow row) {
         this.row = row;
-    }
-
-    public TableBody getBody() {
-        FONode node = getCell();
-        while (node != null && !(node instanceof TableBody)) {
-            node = node.getParent();
-        }
-        return (TableBody) node;
     }
 
     /**

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=631276&r1=631275&r2=631276&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 Tue Feb 26 08:23:15 2008
@@ -23,6 +23,7 @@
 import java.util.List;
 
 import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 import org.apache.fop.layoutmgr.ElementListUtils;
 import org.apache.fop.layoutmgr.table.TableCellLayoutManager;
@@ -69,6 +70,19 @@
         this.isSeparateBorderModel = cell.getTable().isSeparateBorderModel(); // TODO
         this.halfBorderSeparationBPD = cell.getTable().getBorderSeparation().getBPD().getLength()
                 .getValue() / 2;  // TODO
+    }
+
+    /**
+     * Returns the fo:table-header/footer/body element containing this cell.
+     * 
+     * @return the enclosing table part
+     */
+    public TableBody getTableBody() {
+        FONode node = cell.getParent();
+        if (node instanceof TableRow) {
+            node = node.getParent();
+        }
+        return (TableBody) node;
     }
 
     public TableCellLayoutManager getCellLM() {

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=631276&r1=631275&r2=631276&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 Feb 26 08:23:15 2008
@@ -406,7 +406,7 @@
                 lst.add(tcpos);
                 CellPart part = (CellPart)tcpos.cellParts.get(0);
                 if (body == null) {
-                    body = part.pgu.getBody();
+                    body = part.pgu.getTableBody();
                 }
                 if (tcpos.getFlag(TableContentPosition.FIRST_IN_ROWGROUP)
                         && tcpos.getRow().getFlag(EffRow.FIRST_IN_PART)) {



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