aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2009-04-19 17:54:06 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2009-04-19 17:54:06 +0000
commit5deedc814cedf4e1c2ffa746a22bdba34b031d5d (patch)
tree8f837336338a9fb058ab5c6998698ebdfe58db4f /src
parent8ba60984938cc6250b507f5742b4e99e437b7497 (diff)
downloadxmlgraphics-fop-5deedc814cedf4e1c2ffa746a22bdba34b031d5d.tar.gz
xmlgraphics-fop-5deedc814cedf4e1c2ffa746a22bdba34b031d5d.zip
Bugzilla 47027: Correction for interpretation of pixel-lengths, as suggested by Jeremias.
+ minor changes to the fotreetest-classes: distinguish between fatal errors due to malformed testcases, and genuine assertion failures. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@766492 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/fo/expr/PropertyParser.java15
-rw-r--r--src/java/org/apache/fop/fo/properties/LengthProperty.java5
2 files changed, 13 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/fo/expr/PropertyParser.java b/src/java/org/apache/fop/fo/expr/PropertyParser.java
index 4f1cdbdc6..87f640651 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyParser.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyParser.java
@@ -19,6 +19,12 @@
package org.apache.fop.fo.expr;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.xmlgraphics.util.UnitConv;
+
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.LengthBase;
import org.apache.fop.datatypes.Numeric;
@@ -31,10 +37,6 @@ import org.apache.fop.fo.properties.PercentLength;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.StringProperty;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-
/**
* Class to parse XSL-FO property expressions.
* This class is heavily based on the epxression parser in James Clark's
@@ -312,10 +314,11 @@ public final class PropertyParser extends PropertyTokenizer {
if ("px".equals(unitPart)) {
//pass the ratio between target-resolution and
//the default resolution of 72dpi
+ float resolution = propInfo.getPropertyList().getFObj()
+ .getUserAgent().getSourceResolution();
prop = FixedLength.getInstance(
numPart, unitPart,
- propInfo.getPropertyList().getFObj()
- .getUserAgent().getTargetResolution() / 72.0f);
+ UnitConv.IN2PT / resolution);
} else {
//use default resolution of 72dpi
prop = FixedLength.getInstance(numPart, unitPart);
diff --git a/src/java/org/apache/fop/fo/properties/LengthProperty.java b/src/java/org/apache/fop/fo/properties/LengthProperty.java
index 16bbe430c..3f569054e 100644
--- a/src/java/org/apache/fop/fo/properties/LengthProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthProperty.java
@@ -19,6 +19,8 @@
package org.apache.fop.fo.properties;
+import org.apache.xmlgraphics.util.UnitConv;
+
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FObj;
@@ -57,9 +59,10 @@ public abstract class LengthProperty extends Property
}
if (p instanceof NumberProperty) {
//Assume pixels (like in HTML) when there's no unit
+ float resolution = propertyList.getFObj().getUserAgent().getSourceResolution();
return FixedLength.getInstance(
p.getNumeric().getNumericValue(), "px",
- propertyList.getFObj().getUserAgent().getTargetResolution() / 72.0f);
+ UnitConv.IN2PT / resolution);
}
Length val = p.getLength();
if (val != null) {