jeremias 2003/11/07 13:49:02 Modified: src/java/org/apache/fop/apps Driver.java Log: Tried to fix basic driver tests but didn't manage, yet. Some initialisation code moved from render() to getContentHandler(). Revision Changes Path 1.45 +15 -17 xml-fop/src/java/org/apache/fop/apps/Driver.java Index: Driver.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- Driver.java 4 Nov 2003 23:59:11 -0000 1.44 +++ Driver.java 7 Nov 2003 21:49:02 -0000 1.45 @@ -540,8 +540,23 @@ 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; return treeBuilder; } @@ -568,24 +583,7 @@ */ public synchronized void render(XMLReader parser, InputSource source) throws FOPException { - if (!isInitialized()) { - initialize(); - } - /** 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); - } parser.setContentHandler(getContentHandler()); - 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.foTreeControl = currentDocument; try { if (foInputHandler instanceof FOTreeHandler) { FOTreeHandler foTreeHandler = (FOTreeHandler)foInputHandler;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]