diff options
Diffstat (limited to 'src/java/org/apache/fop/fo/FOTreeBuilder.java')
-rw-r--r-- | src/java/org/apache/fop/fo/FOTreeBuilder.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/fo/FOTreeBuilder.java b/src/java/org/apache/fop/fo/FOTreeBuilder.java index 2711bd169..f64bae87a 100644 --- a/src/java/org/apache/fop/fo/FOTreeBuilder.java +++ b/src/java/org/apache/fop/fo/FOTreeBuilder.java @@ -304,6 +304,10 @@ public class FOTreeBuilder extends DefaultHandler { try { foNode = fobjMaker.make(currentFObj); + if (rootFObj == null) { + rootFObj = (Root) foNode; + rootFObj.setFOEventHandler(foEventHandler); + } propertyList = foNode.createPropertyList(currentPropertyList, foEventHandler); foNode.processNode(localName, getEffectiveLocator(), attlist, propertyList); foNode.startOfNode(); @@ -325,10 +329,7 @@ public class FOTreeBuilder extends DefaultHandler { delegate = subHandler; } - if (rootFObj == null) { - rootFObj = (Root) foNode; - rootFObj.setFOEventHandler(foEventHandler); - } else { + if (currentFObj != null) { currentFObj.addChildNode(foNode); } |