aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/flow
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2008-02-26 16:23:15 +0000
committerVincent Hennebert <vhennebert@apache.org>2008-02-26 16:23:15 +0000
commitd99ae9c232e91f5cb6258a1789f6a55de19344d0 (patch)
treea9203f17531a41f84e4fe5f37dffd3b5b02e14d2 /src/java/org/apache/fop/fo/flow
parent2664dde568e2bd1d7519b66347bd8d6f7ecf80f1 (diff)
downloadxmlgraphics-fop-d99ae9c232e91f5cb6258a1789f6a55de19344d0.tar.gz
xmlgraphics-fop-d99ae9c232e91f5cb6258a1789f6a55de19344d0.zip
Moved the getBody method into PrimaryGridUnit, since it's only needed there and that allows to simplify EmptyGridUnit
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@631276 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow')
-rw-r--r--src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java7
-rw-r--r--src/java/org/apache/fop/fo/flow/table/GridUnit.java9
-rw-r--r--src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java14
3 files changed, 14 insertions, 16 deletions
diff --git a/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java b/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java
index 201029ff1..2c910d3f8 100644
--- a/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java
+++ b/src/java/org/apache/fop/fo/flow/table/EmptyGridUnit.java
@@ -25,8 +25,6 @@ package org.apache.fop.fo.flow.table;
*/
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)
@@ -57,11 +55,6 @@ public class EmptyGridUnit extends GridUnit {
}
/** {@inheritDoc} */
- public TableBody getBody() {
- return this.body;
- }
-
- /** {@inheritDoc} */
public boolean isLastGridUnitColSpan() {
return true;
}
diff --git a/src/java/org/apache/fop/fo/flow/table/GridUnit.java b/src/java/org/apache/fop/fo/flow/table/GridUnit.java
index 23d1cc001..b9394ff31 100644
--- a/src/java/org/apache/fop/fo/flow/table/GridUnit.java
+++ b/src/java/org/apache/fop/fo/flow/table/GridUnit.java
@@ -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;
@@ -165,14 +164,6 @@ public class GridUnit {
this.row = row;
}
- public TableBody getBody() {
- FONode node = getCell();
- while (node != null && !(node instanceof TableBody)) {
- node = node.getParent();
- }
- return (TableBody) node;
- }
-
/**
* Returns the before-start grid unit of the cell containing this grid unit.
*
diff --git a/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java b/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java
index 1a47a7dcf..297a3176c 100644
--- a/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java
+++ b/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java
@@ -23,6 +23,7 @@ import java.util.LinkedList;
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;
@@ -71,6 +72,19 @@ public class PrimaryGridUnit extends GridUnit {
.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() {
assert cellLM != null;
return cellLM;