diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2007-10-26 10:25:07 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2007-10-26 10:25:07 +0000 |
commit | 3c46ea500a59c995e1e1bd4085a1e9a3c2240d8a (patch) | |
tree | edd5bacc1bf0417bbe3cb3af5ba58713035902d4 /src | |
parent | 171c4cd5da4e8bf3e3baf45362cac8632100bd15 (diff) | |
download | xmlgraphics-fop-3c46ea500a59c995e1e1bd4085a1e9a3c2240d8a.tar.gz xmlgraphics-fop-3c46ea500a59c995e1e1bd4085a1e9a3c2240d8a.zip |
Moved the creation of the columns list to the declaration of the columns field. Even if there are no explicit columns the list will have to be created anyway.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@588597 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/fo/flow/Table.java | 8 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/flow/TableBody.java | 6 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/fo/flow/Table.java b/src/java/org/apache/fop/fo/flow/Table.java index b70e5ea21..e752c5fbe 100644 --- a/src/java/org/apache/fop/fo/flow/Table.java +++ b/src/java/org/apache/fop/fo/flow/Table.java @@ -19,6 +19,7 @@ package org.apache.fop.fo.flow; +import java.util.ArrayList; import java.util.BitSet; import java.util.List; @@ -70,7 +71,7 @@ public class Table extends TableFObj { private Length orphanContentLimit; /** collection of columns in this table */ - protected List columns = null; + protected List columns = new ArrayList(); /** helper variables for implicit column-numbering */ private int columnIndex = 1; @@ -239,9 +240,6 @@ public class Table extends TableFObj { switch (childId) { case FO_TABLE_COLUMN: - if (columns == null) { - columns = new java.util.ArrayList(); - } if (!inMarker()) { addColumnNode((TableColumn) child); } else { @@ -342,7 +340,7 @@ public class Table extends TableFObj { public List getColumns() { return columns; } - + /** @return the body for the table-header. */ public TableBody getTableHeader() { return tableHeader; diff --git a/src/java/org/apache/fop/fo/flow/TableBody.java b/src/java/org/apache/fop/fo/flow/TableBody.java index 3c68410f5..44369d899 100644 --- a/src/java/org/apache/fop/fo/flow/TableBody.java +++ b/src/java/org/apache/fop/fo/flow/TableBody.java @@ -165,12 +165,6 @@ public class TableBody extends TableCellContainer { protected void addChildNode(FONode child) throws FOPException { if (!inMarker()) { if (firstRow) { - Table t = getTable(); - - if (t.columns == null) { - t.columns = new java.util.ArrayList(); - } - switch (child.getNameId()) { case FO_TABLE_ROW: firstRow = false; |