aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/properties
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-09-16 08:50:14 +0000
committerJeremias Maerki <jeremias@apache.org>2005-09-16 08:50:14 +0000
commit29697aee2699b47a3951a266463306b88ce2c38b (patch)
tree5f6bb78b565ec84c8a342e95196809f1dbdbee61 /src/java/org/apache/fop/fo/properties
parent2fb4799fb303c4d6aeeb413cdccfd08341fb3cae (diff)
downloadxmlgraphics-fop-29697aee2699b47a3951a266463306b88ce2c38b.tar.gz
xmlgraphics-fop-29697aee2699b47a3951a266463306b88ce2c38b.zip
Provide the TABLE_UNITS base value through the PrecentageBaseContext.
Remove the LayoutDimension mechanism entirely. This fixes a problem with proportional-column-width() in nested tables. The LayoutDimension mechanism would look in the parent table for the base value when the base value for the actual table was only just calculated. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@289439 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/properties')
-rw-r--r--src/java/org/apache/fop/fo/properties/TableColLength.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/fo/properties/TableColLength.java b/src/java/org/apache/fop/fo/properties/TableColLength.java
index 554501c73..0b7b710f5 100644
--- a/src/java/org/apache/fop/fo/properties/TableColLength.java
+++ b/src/java/org/apache/fop/fo/properties/TableColLength.java
@@ -18,8 +18,8 @@
package org.apache.fop.fo.properties;
+import org.apache.fop.datatypes.LengthBase;
import org.apache.fop.datatypes.PercentBaseContext;
-import org.apache.fop.datatypes.PercentBase;
import org.apache.fop.fo.FObj;
/**
@@ -40,13 +40,14 @@ public class TableColLength extends LengthProperty {
private double tcolUnits;
/**
- * The column the this column-units are defined on.
+ * The column the column-units are defined on.
*/
private FObj column;
/**
* Construct an object with tcolUnits of proportional measure.
* @param tcolUnits number of table-column proportional units
+ * @param column the column the column-units are defined on
*/
public TableColLength(double tcolUnits, FObj column) {
this.tcolUnits = tcolUnits;
@@ -74,14 +75,15 @@ public class TableColLength extends LengthProperty {
* @see org.apache.fop.datatypes.Numeric#getNumericValue()
*/
public double getNumericValue() {
- return tcolUnits * column.getLayoutDimension(PercentBase.TABLE_UNITS).floatValue();
+ throw new UnsupportedOperationException(
+ "Must call getNumericValue with PercentageBaseContext");
}
/**
* @see org.apache.fop.datatypes.Numeric#getNumericValue(PercentBaseContext)
*/
public double getNumericValue(PercentBaseContext context) {
- return getNumericValue();
+ return tcolUnits * context.getBaseLength(LengthBase.TABLE_UNITS, column);
}
/**
@@ -89,14 +91,15 @@ public class TableColLength extends LengthProperty {
* @see org.apache.fop.datatypes.Length#getValue()
*/
public int getValue() {
- return (int) (tcolUnits * column.getLayoutDimension(PercentBase.TABLE_UNITS).floatValue());
+ throw new UnsupportedOperationException(
+ "Must call getValue with PercentageBaseContext");
}
/**
* @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
- return getValue();
+ return (int) (tcolUnits * context.getBaseLength(LengthBase.TABLE_UNITS, column));
}
/**