diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2008-02-10 13:42:39 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2008-02-10 13:42:39 +0000 |
commit | c29d8e5488fa1b749647f2e5f35129271b2dae48 (patch) | |
tree | 1b16fa21bef93b4964c9290311974ba49d32e160 /src | |
parent | 4b584311505ac639952ec29d9983161b5682b80a (diff) | |
download | xmlgraphics-fop-c29d8e5488fa1b749647f2e5f35129271b2dae48.tar.gz xmlgraphics-fop-c29d8e5488fa1b749647f2e5f35129271b2dae48.zip |
Bugzilla 41631: Percentage resolution for arguments to proportional-column-width()
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@620285 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/fo/expr/PPColWidthFunction.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java index 08ec34732..394035b49 100644 --- a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java +++ b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java @@ -19,6 +19,8 @@ package org.apache.fop.fo.expr; +import org.apache.fop.datatypes.PercentBase; +import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.flow.table.Table; import org.apache.fop.fo.properties.Property; @@ -38,6 +40,13 @@ public class PPColWidthFunction extends FunctionBase { return 1; } + /** + * @return the {@link PercentBase} for the proportional-column-width() + * function + */ + public PercentBase getPercentBase() { + return new PPColWidthPercentBase(); + } /** * * @param args array of arguments for this function @@ -69,4 +78,24 @@ public class PPColWidthFunction extends FunctionBase { return new TableColLength(d.doubleValue(), pInfo.getFO()); } + private static class PPColWidthPercentBase implements PercentBase { + + /** {@inheritDoc} */ + public int getBaseLength(PercentBaseContext context) throws PropertyException { + return 0; + } + + /** {@inheritDoc} */ + public double getBaseValue() { + //make sure percentage-arguments are interpreted + //as numerics (1% = 1 * 0.01) + return 1; + } + + /** {@inheritDoc} */ + public int getDimension() { + return 0; + } + + } } |