From 03f65a7b8b6d294cff0a6888b466e72da83fead2 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Wed, 11 Apr 2012 21:29:51 +0000 Subject: Bugzilla #52763: Support list-block in marker, thus preventing NPE. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1325016 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/fo/flow/AbstractRetrieveMarker.java | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/java/org/apache/fop/fo/flow') diff --git a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java index 51ae7441d..62c821504 100644 --- a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java +++ b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java @@ -103,17 +103,30 @@ public abstract class AbstractRetrieveMarker extends FObjMixed { pList, newPropertyList); addChildTo(newChild, newParent); - if (newChild.getNameId() == FO_TABLE) { + switch ( newChild.getNameId() ) { + case FO_TABLE: Table t = (Table) child; cloneSubtree(t.getColumns().iterator(), - newChild, marker, newPropertyList); + newChild, marker, newPropertyList); cloneSingleNode(t.getTableHeader(), - newChild, marker, newPropertyList); + newChild, marker, newPropertyList); cloneSingleNode(t.getTableFooter(), - newChild, marker, newPropertyList); + newChild, marker, newPropertyList); + cloneSubtree(child.getChildNodes(), + newChild, marker, newPropertyList); + break; + case FO_LIST_ITEM: + ListItem li = (ListItem) child; + cloneSingleNode(li.getLabel(), + newChild, marker, newPropertyList); + cloneSingleNode(li.getBody(), + newChild, marker, newPropertyList); + break; + default: + cloneSubtree(child.getChildNodes(), + newChild, marker, newPropertyList); + break; } - cloneSubtree(child.getChildNodes(), newChild, - marker, newPropertyList); } else if (child instanceof FOText) { FOText ft = (FOText) newChild; ft.bind(parentPropertyList); -- cgit v1.2.3