aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hancock <phancock@apache.org>2013-01-09 09:37:11 +0000
committerPeter Hancock <phancock@apache.org>2013-01-09 09:37:11 +0000
commit91d9b34a7a9a443e58938697d2a5cb43a9475d77 (patch)
tree562f101c5c9decc81bfde8ef01138cc27494f6c0
parent824c570eb4d7d99d2d78e5eaeb1a19549352846e (diff)
downloadxmlgraphics-fop-91d9b34a7a9a443e58938697d2a5cb43a9475d77.tar.gz
xmlgraphics-fop-91d9b34a7a9a443e58938697d2a5cb43a9475d77.zip
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 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1430746 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/fo/FOValidationEventProducer.java14
-rw-r--r--src/java/org/apache/fop/fo/FOValidationEventProducer.xml1
-rw-r--r--src/java/org/apache/fop/fo/FObj.java8
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java8
-rw-r--r--src/java/org/apache/fop/render/ps/PSTextPainter.java6
-rw-r--r--status.xml3
6 files changed, 27 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/fo/FOValidationEventProducer.java b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
index 98b118952..c79b2b803 100644
--- a/src/java/org/apache/fop/fo/FOValidationEventProducer.java
+++ b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
@@ -221,6 +221,20 @@ public interface FOValidationEventProducer extends EventProducer {
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
diff --git a/src/java/org/apache/fop/fo/FOValidationEventProducer.xml b/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
index a8b2fffb1..9f23557c3 100644
--- a/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
+++ b/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
@@ -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>
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index b19ccbe20..a316a2260 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -133,13 +133,11 @@ public abstract class FObj extends FONode implements Constants {
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());
}
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java b/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
index c7a4a6a34..2ef70b15e 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
@@ -179,13 +179,13 @@ public class ImageLayout implements Constants {
//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;
diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java
index eb2188026..9abe37ed7 100644
--- a/src/java/org/apache/fop/render/ps/PSTextPainter.java
+++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java
@@ -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.MultiByteFont;
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}.
diff --git a/status.xml b/status.xml
index bec3c3974..efbd518b2 100644
--- a/status.xml
+++ b/status.xml
@@ -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.