xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acumis...@apache.org
Subject svn commit: r706271 - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./ examples/plan/src/org/apache/fop/plan/PreloaderPlan.java src/java/org/apache/fop/layoutmgr/TraitSetter.java
Date Mon, 20 Oct 2008 13:12:23 GMT
Author: acumiskey
Date: Mon Oct 20 06:12:22 2008
New Revision: 706271

URL: http://svn.apache.org/viewvc?rev=706271&view=rev
Log:
Merged revisions 705529,706135 via svnmerge from 
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r705529 | vhennebert | 2008-10-17 10:36:40 +0100 (Fri, 17 Oct 2008) | 2 lines
  
  Removed superfluous brackets
........
  r706135 | jeremias | 2008-10-20 08:16:47 +0100 (Mon, 20 Oct 2008) | 1 line
  
  Check for plan namespace to avoid errors while parsing plan XML.
........

Modified:
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/   (props changed)
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/TraitSetter.java

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 20 06:12:22 2008
@@ -1,2 +1,2 @@
 /xmlgraphics/fop/branches/fop-0_95:684572,688085,688696
-/xmlgraphics/fop/trunk:693433-698670,699739,704008-704909
+/xmlgraphics/fop/trunk:693433-698670,699739,704008-704909,705529-706135

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Oct 20 06:12:22 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-704933
+/xmlgraphics/fop/trunk:1-706270

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java?rev=706271&r1=706270&r2=706271&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
Mon Oct 20 06:12:22 2008
@@ -30,6 +30,7 @@
 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;
@@ -66,7 +67,7 @@
         return info;
     }
 
-    private ImageInfo getImage(String uri, Source src, ImageContext context) {
+    private ImageInfo getImage(String uri, Source src, ImageContext context) throws IOException
{
 
         InputStream in = new UnclosableInputStream(ImageUtil.needInputStream(src));
         try {
@@ -78,7 +79,14 @@
 
             //Have to render the plan to know its size
             PlanRenderer pr = new PlanRenderer();
-            Document svgDoc = pr.createSVGDocument((Document)res.getNode());
+            Document planDoc = (Document)res.getNode();
+            Element rootEl = planDoc.getDocumentElement();
+            if (!PlanElementMapping.NAMESPACE.equals(rootEl.getNamespaceURI())) {
+                in.reset();
+                return null;
+            }
+
+            Document svgDoc = pr.createSVGDocument(planDoc);
             float width = pr.getWidth();
             float height = pr.getHeight();
 

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/TraitSetter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/TraitSetter.java?rev=706271&r1=706270&r2=706271&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/TraitSetter.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/TraitSetter.java
Mon Oct 20 06:12:22 2008
@@ -395,7 +395,7 @@
                         width += backProps.getPaddingStart(false, context);
                         width += backProps.getPaddingEnd(false, context);
                         int imageWidthMpt = back.getImageInfo().getSize().getWidthMpt();
-                        int lengthBaseValue = (width - imageWidthMpt);
+                        int lengthBaseValue = width - imageWidthMpt;
                         SimplePercentBaseContext simplePercentBaseContext
                             = new SimplePercentBaseContext(context,
                             LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL,
@@ -419,7 +419,7 @@
                         height += backProps.getPaddingBefore(false, context);
                         height += backProps.getPaddingAfter(false, context);
                         int imageHeightMpt = back.getImageInfo().getSize().getHeightMpt();
-                        int lengthBaseValue = (height - imageHeightMpt);
+                        int lengthBaseValue = height - imageHeightMpt;
                         SimplePercentBaseContext simplePercentBaseContext
                             = new SimplePercentBaseContext(context,
                                 LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL,



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message