diff options
author | Glen Mazza <gmazza@apache.org> | 2004-01-09 03:26:00 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-01-09 03:26:00 +0000 |
commit | a01981fc3c8afaa7afcd08c2c5bc509555b712c5 (patch) | |
tree | 7bf252add13e421428e46700488e7a28f12048b6 /src/java/org | |
parent | cbe4125cd6fb95868d1b7b1c4d2d92eccb03a249 (diff) | |
download | xmlgraphics-fop-a01981fc3c8afaa7afcd08c2c5bc509555b712c5.tar.gz xmlgraphics-fop-a01981fc3c8afaa7afcd08c2c5bc509555b712c5.zip |
Bug 25809 (Patch by Finn Bock) NPE for incorrectly created tables fixed.
Also changed text of warning message.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197149 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/AddLMVisitor.java | 13 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/table/Body.java | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java index c502d71b7..be4567ce0 100644 --- a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java +++ b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java @@ -842,12 +842,15 @@ public class AddLMVisitor implements FOTreeVisitor { TableLayoutManager tlm = new TableLayoutManager(); tlm.setUserAgent(node.getUserAgent()); tlm.setFObj(node); - ArrayList columnLMs = new ArrayList(); - ListIterator iter = node.getColumns().listIterator(); - while (iter.hasNext()) { - columnLMs.add(getTableColumnLayoutManager((TableColumn)iter.next())); + ArrayList columns = node.getColumns(); + if (columns != null) { + ArrayList columnLMs = new ArrayList(); + ListIterator iter = columns.listIterator(); + while (iter.hasNext()) { + columnLMs.add(getTableColumnLayoutManager((TableColumn)iter.next())); + } + tlm.setColumns(columnLMs); } - tlm.setColumns(columnLMs); if (node.getTableHeader() != null) { tlm.setTableHeader(getTableBodyLayoutManager(node.getTableHeader())); } diff --git a/src/java/org/apache/fop/layoutmgr/table/Body.java b/src/java/org/apache/fop/layoutmgr/table/Body.java index 5efbd7514..622664ffe 100644 --- a/src/java/org/apache/fop/layoutmgr/table/Body.java +++ b/src/java/org/apache/fop/layoutmgr/table/Body.java @@ -128,7 +128,7 @@ public class Body extends BlockStackingLayoutManager { if (columns == null) { setFinished(true); - getLogger().warn("ignoring table body with undefined columns"); + getLogger().warn("ignoring fo:table-body with undefined fo:table-columns"); return null; } |