You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ph...@apache.org on 2013/01/09 10:37:12 UTC

svn commit: r1430746 - in /xmlgraphics/fop/trunk: ./ src/java/org/apache/fop/fo/ src/java/org/apache/fop/layoutmgr/inline/ src/java/org/apache/fop/render/ps/

Author: phancock
Date: Wed Jan  9 09:37:11 2013
New Revision: 1430746

URL: http://svn.apache.org/viewvc?rev=1430746&view=rev
Log:
JIRA#FOP-1069:  Warn instead or error on invalid property values.
--Thi--s line, and those below, will be ignored--

M    src/java/org/apache/fop/render/ps/PSTextPainter.java
M    src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
M    src/java/org/apache/fop/fo/FObj.java
M    src/java/org/apache/fop/fo/FOValidationEventProducer.java
M    src/java/org/apache/fop/fo/FOValidationEventProducer.xml
M    status.xml

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java Wed Jan  9 09:37:11 2013
@@ -221,6 +221,20 @@ public interface FOValidationEventProduc
             Locator loc);
 
     /**
+     * An invalid property value was encountered.
+     * @param source the event source
+     * @param elementName the name of the context node
+     * @param propName the property name
+     * @param propValue the property value
+     * @param e the property exception caused by the invalid value
+     * @param loc the location of the error or null
+     * @event.severity WARN
+     */
+    void warnOnInvalidPropertyValue(Object source, String elementName,
+            String propName, String propValue, PropertyException e,
+            Locator loc);
+
+    /**
      * A feature is not supported, yet.
      * @param source the event source
      * @param elementName the name of the context node

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml Wed Jan  9 09:37:11 2013
@@ -26,6 +26,7 @@
   <message key="markerNotUniqueForSameParent">fo:marker "marker-class-name" must be unique for same parent: {mcname}{{locator}}</message>
   <message key="invalidProperty">Invalid property encountered on "{elementName}": {attr}{{locator}}</message>
   <message key="invalidPropertyValue">Invalid property value encountered in {propName}="{propValue}"[: {e}]{{locator}}</message>
+  <message key="warnOnInvalidPropertyValue">Invalid property value encountered in {propName}="{propValue}"[: {e}]{{locator}}</message>  
   <message key="unimplementedFeature">The following feature isn't implemented by Apache FOP, yet: {feature} (on {elementName}){{locator}}</message>
   <message key="missingLinkDestination">Missing attribute on {elementName}: Either external-destination or internal-destination must be specified.{{locator}}</message>
   <message key="markerCloningFailed">Unable to clone subtree of fo:marker (marker-class-name="{markerClassName}") for fo:retrieve-marker.{{locator}}</message>

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java Wed Jan  9 09:37:11 2013
@@ -133,13 +133,11 @@ public abstract class FObj extends FONod
     private void warnOnUnknownProperties(Attributes attlist, String objName, PropertyList propertyList)
             throws FOPException {
         Map<String, Property> unknowns = propertyList.getUnknownPropertyValues();
-        for (Entry<String, Property> value : unknowns.entrySet()) {
-            String unknownProperty = value.getKey();
+        for (Entry<String, Property> entry : unknowns.entrySet()) {
             FOValidationEventProducer producer = FOValidationEventProducer.Provider.get(getUserAgent()
                     .getEventBroadcaster());
-            producer.invalidPropertyValue(this, objName,
-                    getAttributeNameForValue(attlist, unknowns.get(unknownProperty), propertyList),
-                    unknownProperty, null,
+            producer.warnOnInvalidPropertyValue(this, objName,
+                    getAttributeNameForValue(attlist, entry.getValue(), propertyList), entry.getKey(), null,
                     getLocator());
         }
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java Wed Jan  9 09:37:11 2013
@@ -179,13 +179,13 @@ public class ImageLayout implements Cons
         //Adjust viewport if not explicit
         if (ipd == -1) {
             ipd = constrainExtent(cwidth,
-                    props.getInlineProgressionDimension(), (foundNonAuto)
-                    ? props.getContentWidth() : new DefaultLength());
+                    props.getInlineProgressionDimension(), (foundNonAuto) ?
+                            props.getContentWidth() : new DefaultLength());
         }
         if (bpd == -1) {
             bpd = constrainExtent(cheight,
-                    props.getBlockProgressionDimension(), (foundNonAuto)
-                    ? props.getContentHeight() : new DefaultLength());
+                    props.getBlockProgressionDimension(), (foundNonAuto) ?
+                            props.getContentHeight() : new DefaultLength());
         }
 
         this.clip = false;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java Wed Jan  9 09:37:11 2013
@@ -38,10 +38,6 @@ import java.util.List;
 import org.apache.batik.gvt.font.GVTGlyphVector;
 import org.apache.batik.gvt.text.TextPaintInfo;
 import org.apache.batik.gvt.text.TextSpanLayout;
-
-import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
-import org.apache.xmlgraphics.ps.PSGenerator;
-
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontMetrics;
@@ -50,6 +46,8 @@ import org.apache.fop.fonts.MultiByteFon
 import org.apache.fop.svg.NativeTextPainter;
 import org.apache.fop.util.CharUtilities;
 import org.apache.fop.util.HexEncoder;
+import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
+import org.apache.xmlgraphics.ps.PSGenerator;
 
 /**
  * Renders the attributed character iterator of a {@link org.apache.batik.gvt.TextNode TextNode}.

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Wed Jan  9 09:37:11 2013
@@ -59,6 +59,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Code" dev="PH" type="fix" fixes-bug="FOP-1069" due-to="Robert Meyer">
+        Warn instead or error on invalid property values.
+      </action>
       <action context="Layout" dev="CB" type="fix" fixes-bug="FOP-2174" due-to="Robert Meyer">
         When using SVG drawings, if no content-width and content-height is specified, 72 will
         be used instead of the source-resolution option. 



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


Fwd: svn commit: r1430746 - in /xmlgraphics/fop/trunk: ./ src/java/org/apache/fop/fo/ src/java/org/apache/fop/layoutmgr/inline/ src/java/org/apache/fop/render/ps/

Posted by Chris Bowditch <bo...@hotmail.com>.
Hi Peter,

The JIRA issue FOP-1069 still appears to be in an open status and the 
same for your second commit to FOP-2180. I believe they should be marked 
as resolved now that you've committed those patches.

Thanks,

Chris


-------- Original Message --------
Subject: 	svn commit: r1430746 - in /xmlgraphics/fop/trunk: ./ 
src/java/org/apache/fop/fo/ src/java/org/apache/fop/layoutmgr/inline/ 
src/java/org/apache/fop/render/ps/
Date: 	Wed, 09 Jan 2013 09:37:12 -0000
From: 	phancock@apache.org
Reply-To: 	fop-dev@xmlgraphics.apache.org
To: 	fop-commits@xmlgraphics.apache.org



Author: phancock
Date: Wed Jan  9 09:37:11 2013
New Revision: 1430746

URL: http://svn.apache.org/viewvc?rev=1430746&view=rev
Log:
JIRA#FOP-1069:  Warn instead or error on invalid property values.
--Thi--s line, and those below, will be ignored--

M    src/java/org/apache/fop/render/ps/PSTextPainter.java
M    src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
M    src/java/org/apache/fop/fo/FObj.java
M    src/java/org/apache/fop/fo/FOValidationEventProducer.java
M    src/java/org/apache/fop/fo/FOValidationEventProducer.xml
M    status.xml

Modified:
     xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java
     xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
     xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
     xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
     xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java
     xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java Wed Jan  9 09:37:11 2013
@@ -221,6 +221,20 @@ public interface FOValidationEventProduc
              Locator loc);
  
      /**
+     * An invalid property value was encountered.
+     * @param source the event source
+     * @param elementName the name of the context node
+     * @param propName the property name
+     * @param propValue the property value
+     * @param e the property exception caused by the invalid value
+     * @param loc the location of the error or null
+     * @event.severity WARN
+     */
+    void warnOnInvalidPropertyValue(Object source, String elementName,
+            String propName, String propValue, PropertyException e,
+            Locator loc);
+
+    /**
       * A feature is not supported, yet.
       * @param source the event source
       * @param elementName the name of the context node

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.xml Wed Jan  9 09:37:11 2013
@@ -26,6 +26,7 @@
    <message key="markerNotUniqueForSameParent">fo:marker "marker-class-name" must be unique for same parent: {mcname}{{locator}}</message>
    <message key="invalidProperty">Invalid property encountered on "{elementName}": {attr}{{locator}}</message>
    <message key="invalidPropertyValue">Invalid property value encountered in {propName}="{propValue}"[: {e}]{{locator}}</message>
+  <message key="warnOnInvalidPropertyValue">Invalid property value encountered in {propName}="{propValue}"[: {e}]{{locator}}</message>
    <message key="unimplementedFeature">The following feature isn't implemented by Apache FOP, yet: {feature} (on {elementName}){{locator}}</message>
    <message key="missingLinkDestination">Missing attribute on {elementName}: Either external-destination or internal-destination must be specified.{{locator}}</message>
    <message key="markerCloningFailed">Unable to clone subtree of fo:marker (marker-class-name="{markerClassName}") for fo:retrieve-marker.{{locator}}</message>

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java Wed Jan  9 09:37:11 2013
@@ -133,13 +133,11 @@ public abstract class FObj extends FONod
      private void warnOnUnknownProperties(Attributes attlist, String objName, PropertyList propertyList)
              throws FOPException {
          Map<String, Property> unknowns = propertyList.getUnknownPropertyValues();
-        for (Entry<String, Property> value : unknowns.entrySet()) {
-            String unknownProperty = value.getKey();
+        for (Entry<String, Property> entry : unknowns.entrySet()) {
              FOValidationEventProducer producer = FOValidationEventProducer.Provider.get(getUserAgent()
                      .getEventBroadcaster());
-            producer.invalidPropertyValue(this, objName,
-                    getAttributeNameForValue(attlist, unknowns.get(unknownProperty), propertyList),
-                    unknownProperty, null,
+            producer.warnOnInvalidPropertyValue(this, objName,
+                    getAttributeNameForValue(attlist, entry.getValue(), propertyList), entry.getKey(), null,
                      getLocator());
          }
      }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java Wed Jan  9 09:37:11 2013
@@ -179,13 +179,13 @@ public class ImageLayout implements Cons
          //Adjust viewport if not explicit
          if (ipd == -1) {
              ipd = constrainExtent(cwidth,
-                    props.getInlineProgressionDimension(), (foundNonAuto)
-                    ? props.getContentWidth() : new DefaultLength());
+                    props.getInlineProgressionDimension(), (foundNonAuto) ?
+                            props.getContentWidth() : new DefaultLength());
          }
          if (bpd == -1) {
              bpd = constrainExtent(cheight,
-                    props.getBlockProgressionDimension(), (foundNonAuto)
-                    ? props.getContentHeight() : new DefaultLength());
+                    props.getBlockProgressionDimension(), (foundNonAuto) ?
+                            props.getContentHeight() : new DefaultLength());
          }
  
          this.clip = false;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSTextPainter.java Wed Jan  9 09:37:11 2013
@@ -38,10 +38,6 @@ import java.util.List;
  import org.apache.batik.gvt.font.GVTGlyphVector;
  import org.apache.batik.gvt.text.TextPaintInfo;
  import org.apache.batik.gvt.text.TextSpanLayout;
-
-import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
-import org.apache.xmlgraphics.ps.PSGenerator;
-
  import org.apache.fop.fonts.Font;
  import org.apache.fop.fonts.FontInfo;
  import org.apache.fop.fonts.FontMetrics;
@@ -50,6 +46,8 @@ import org.apache.fop.fonts.MultiByteFon
  import org.apache.fop.svg.NativeTextPainter;
  import org.apache.fop.util.CharUtilities;
  import org.apache.fop.util.HexEncoder;
+import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
+import org.apache.xmlgraphics.ps.PSGenerator;
  
  /**
   * Renders the attributed character iterator of a {@link org.apache.batik.gvt.TextNode TextNode}.

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1430746&r1=1430745&r2=1430746&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Wed Jan  9 09:37:11 2013
@@ -59,6 +59,9 @@
        documents. Example: the fix of marks layering will be such a case when it's done.
      -->
      <release version="FOP Trunk" date="TBD">
+      <action context="Code" dev="PH" type="fix" fixes-bug="FOP-1069" due-to="Robert Meyer">
+        Warn instead or error on invalid property values.
+      </action>
        <action context="Layout" dev="CB" type="fix" fixes-bug="FOP-2174" due-to="Robert Meyer">
          When using SVG drawings, if no content-width and content-height is specified, 72 will
          be used instead of the source-resolution option.



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