aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/expr
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2006-08-17 09:40:14 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2006-08-17 09:40:14 +0000
commitd8585973eca339b3e6556e9e0372ec03b699474a (patch)
treef923e024038512835487fb4ece3dff2e677f1767 /src/java/org/apache/fop/fo/expr
parent8244a3fc897a61644cd65d3e2ea02ffc0dba47f8 (diff)
downloadxmlgraphics-fop-d8585973eca339b3e6556e9e0372ec03b699474a.tar.gz
xmlgraphics-fop-d8585973eca339b3e6556e9e0372ec03b699474a.zip
Should cause an error when used with auto-layout
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@432190 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/expr')
-rw-r--r--src/java/org/apache/fop/fo/expr/PPColWidthFunction.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
index ba9ae2ddf..af485d284 100644
--- a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
+++ b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
@@ -19,7 +19,7 @@
package org.apache.fop.fo.expr;
-
+import org.apache.fop.fo.flow.Table;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.TableColLength;
@@ -53,11 +53,18 @@ public class PPColWidthFunction extends FunctionBase {
throw new PropertyException("Non numeric operand to "
+ "proportional-column-width function");
}
- if (!pInfo.getPropertyList().getFObj().getName().equals("fo:table-column")) {
+ if (!"fo:table-column".equals(
+ pInfo.getPropertyList().getFObj().getName())) {
throw new PropertyException("proportional-column-width function "
+ "may only be used on table-column FO");
}
- // Check if table-layout is "fixed"...
+
+ Table t = (Table) pInfo.getPropertyList().getParentFObj();
+ if (t.isAutoLayout()) {
+ throw new PropertyException("proportional-column-width() function "
+ + "may only be used when fo:table has "
+ + "table-layout=\"fixed\".");
+ }
return new TableColLength(d.doubleValue(), pInfo.getFO());
}