]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Safer handling of treebuilder variable within Driver.reset(), also Driver.setRenderer...
authorGlen Mazza <gmazza@apache.org>
Tue, 5 Aug 2003 22:39:51 +0000 (22:39 +0000)
committerGlen Mazza <gmazza@apache.org>
Tue, 5 Aug 2003 22:39:51 +0000 (22:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196775 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/apps/Driver.java

index 5f6b15679b7f2a7565906eafadd6b53494ee2e5e..0baab114c9794674cb93cbbf2a869401fa902b3d 100644 (file)
@@ -59,6 +59,7 @@ import org.apache.fop.fo.FOTreeHandler;
 import org.apache.fop.mif.MIFHandler;
 import org.apache.fop.render.Renderer;
 import org.apache.fop.render.awt.AWTPrintRenderer;
+import org.apache.fop.render.awt.AWTRenderer;
 import org.apache.fop.rtf.renderer.RTFHandler;
 import org.apache.fop.tools.DocumentInputSource;
 import org.apache.fop.tools.DocumentReader;
@@ -321,7 +322,9 @@ public class Driver implements LogEnabled {
         source = null;
         stream = null;
         reader = null;
-        treeBuilder.reset();
+        if (treeBuilder != null) {
+            treeBuilder.reset();
+        }
     }
 
     /**
@@ -424,6 +427,10 @@ public class Driver implements LogEnabled {
      * @param renderer the renderer instance to use (Note: Logger must be set at this point)
      */
     public void setRenderer(Renderer renderer) {
+        // AWTStarter calls this function directly
+        if (renderer instanceof AWTRenderer) {
+            rendererType = RENDER_AWT;
+        }
         renderer.setProducer(Version.getVersion());
         renderer.setUserAgent(getUserAgent());
         this.renderer = renderer;