aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2003-11-07 21:49:02 +0000
committerJeremias Maerki <jeremias@apache.org>2003-11-07 21:49:02 +0000
commitab987f1da4b78523b33915df0cb3f700baa693ed (patch)
treedcf9687bd81a64875c1653554d373f047df04914 /src/java
parent3e03b129dc1a53fd16552ea9ebeac7957ba41b2e (diff)
downloadxmlgraphics-fop-ab987f1da4b78523b33915df0cb3f700baa693ed.tar.gz
xmlgraphics-fop-ab987f1da4b78523b33915df0cb3f700baa693ed.zip
Tried to fix basic driver tests but didn't manage, yet.
Some initialisation code moved from render() to getContentHandler(). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196986 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/fop/apps/Driver.java32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/java/org/apache/fop/apps/Driver.java b/src/java/org/apache/fop/apps/Driver.java
index 52d05da2a..2115b7c94 100644
--- a/src/java/org/apache/fop/apps/Driver.java
+++ b/src/java/org/apache/fop/apps/Driver.java
@@ -540,8 +540,23 @@ public class Driver implements LogEnabled {
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 class Driver implements LogEnabled {
*/
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;