aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org')
-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) {