From 8bedf21f4562fa1064d0d4587b7ab21c9a1e9a00 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sat, 8 Nov 2003 14:00:02 +0000 Subject: [PATCH] Fix Document construction in getContentHandler() (it was done too late) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196993 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/Driver.java | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/java/org/apache/fop/apps/Driver.java b/src/java/org/apache/fop/apps/Driver.java index 2115b7c94..970a58dc2 100644 --- a/src/java/org/apache/fop/apps/Driver.java +++ b/src/java/org/apache/fop/apps/Driver.java @@ -524,6 +524,19 @@ public class Driver implements LogEnabled { validateOutputStream(); } + /** Document creation is hard-wired for now, but needs to be made + accessible through the API and/or configuration */ + if (currentDocument == null) { + currentDocument = new Document(this); + } + /** LayoutStrategy is hard-wired for now, but needs to be made + accessible through the API and/or configuration */ + if (foInputHandler instanceof FOTreeHandler) { + if (currentDocument.getLayoutStrategy() == null) { + currentDocument.setLayoutStrategy(new LayoutManagerLS(currentDocument)); + } + } + // TODO: - do this stuff in a better way // PIJ: I guess the structure handler should be created by the renderer. if (rendererType == RENDER_MIF) { @@ -537,23 +550,10 @@ public class Driver implements LogEnabled { } foInputHandler = new FOTreeHandler(currentDocument, true); } + currentDocument.foInputHandler = foInputHandler; foInputHandler.enableLogging(getLogger()); - /** Document creation is hard-wired for now, but needs to be made - accessible through the API and/or configuration */ - if (currentDocument == null) { - currentDocument = new Document(this); - } - currentDocument.foInputHandler = foInputHandler; - /** LayoutStrategy is hard-wired for now, but needs to be made - accessible through the API and/or configuration */ - if (foInputHandler instanceof FOTreeHandler) { - if (currentDocument.getLayoutStrategy() == null) { - currentDocument.setLayoutStrategy(new LayoutManagerLS(currentDocument)); - } - } - treeBuilder.setUserAgent(getUserAgent()); treeBuilder.setFOInputHandler(foInputHandler); treeBuilder.foTreeControl = currentDocument; -- 2.39.5