]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix Document construction in getContentHandler() (it was done too late)
authorJeremias Maerki <jeremias@apache.org>
Sat, 8 Nov 2003 14:00:02 +0000 (14:00 +0000)
committerJeremias Maerki <jeremias@apache.org>
Sat, 8 Nov 2003 14:00:02 +0000 (14:00 +0000)
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

index 2115b7c94dfc2f09c7126bf7d947513db2591b92..970a58dc2743f0ed713e6fa42749f92888c7a089 100644 (file)
@@ -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;