From d8585973eca339b3e6556e9e0372ec03b699474a Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Thu, 17 Aug 2006 09:40:14 +0000 Subject: [PATCH] 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 --- .../org/apache/fop/fo/expr/PPColWidthFunction.java | 13 ++++++++++--- 1 file 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()); } -- 2.39.5