summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-10-21 08:58:08 +0000
committerJeremias Maerki <jeremias@apache.org>2008-10-21 08:58:08 +0000
commit8b65aafce052c7048b2366cd2ac73cbfbcb9c154 (patch)
tree67b41c84b03fbd83300bcd7aa103606374f67f28 /examples
parentd6d3411ca856d605080c25624da32cd9ad1df9bb (diff)
parente157058f724241cee23ad406fb2fd3707a4efac3 (diff)
downloadxmlgraphics-fop-8b65aafce052c7048b2366cd2ac73cbfbcb9c154.tar.gz
xmlgraphics-fop-8b65aafce052c7048b2366cd2ac73cbfbcb9c154.zip
Merge from Trunk revisions 699793 to 706550.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@706553 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples')
-rw-r--r--examples/plan/src/org/apache/fop/plan/PreloaderPlan.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java b/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
index 902560e96..f99c94af9 100644
--- a/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
+++ b/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
@@ -30,6 +30,7 @@ import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -76,15 +77,15 @@ public class PreloaderPlan extends AbstractImagePreloader {
DOMResult res = new DOMResult();
transformer.transform(source, res);
+ //Have to render the plan to know its size
+ PlanRenderer pr = new PlanRenderer();
Document planDoc = (Document)res.getNode();
- if (!PlanElementMapping.NAMESPACE.equals(
- planDoc.getDocumentElement().getNamespaceURI())) {
+ Element rootEl = planDoc.getDocumentElement();
+ if (!PlanElementMapping.NAMESPACE.equals(rootEl.getNamespaceURI())) {
in.reset();
return null;
}
- //Have to render the plan to know its size
- PlanRenderer pr = new PlanRenderer();
Document svgDoc = pr.createSVGDocument(planDoc);
float width = pr.getWidth();
float height = pr.getHeight();