<xsl:text>
public Property compute(PropertyList propertyList) {
Property computedProperty = null;
- Property correspondingProperty = propertyList.get("</xsl:text>
- <xsl:value-of select="derive/@from"/>
- <xsl:text>");
+ Property correspondingProperty = propertyList.get(Constants.PR_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select="derive/@from"/>
+ </xsl:call-template>
+ <xsl:text>);
if (correspondingProperty != null) {
int correspondingValue = correspondingProperty.getEnum();</xsl:text>
<xsl:for-each select="derive/if">
/**
* Construct an instance of a Property.Maker.
- * Note: the property name is set to "UNKNOWN".
+ * Note: the property ID is set to zero
*/
protected Maker() {
this.propId = 0;
return get(propertyName, false, false);
}
-
/**
* Return the property on the current FlowObject. If it isn't set explicitly,
* this will try to compute it based on other properties, or if it is
package org.apache.fop.fo.expr;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.FOPropertyMapping;
/**
if (propName == null) {
throw new PropertyException("Incorrect parameter to _int-property-value function");
}
- // System.err.println("Get property-value for " + propName);
- return pInfo.getPropertyList().get(propName);
+
+ int propId = FOPropertyMapping.getPropertyId(propName);
+ return pInfo.getPropertyList().get(propId);
}
}
import org.apache.fop.fo.properties.CommonBorderAndPadding;
import org.apache.fop.fo.properties.CommonMarginInline;
import org.apache.fop.fo.properties.CommonRelativePosition;
+//import org.apache.fop.fo.properties.FOPropertyMapping;
import org.apache.fop.fo.properties.LeaderPattern;
import org.apache.fop.fonts.Font;
public int getLength(String prop, int dim) {
int length;
+// int propId = FOPropertyMapping.getPropertyId(prop);
+// System.out.println("prop/propID = " + prop + " " + propId);
Length maxlength = propertyList.get(prop).getLength();
if (maxlength instanceof PercentLength) {
length = (int)(((PercentLength)maxlength).value()
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
import org.apache.fop.fo.properties.CommonRelativePosition;
+import org.apache.fop.fo.properties.FOPropertyMapping;
/**
* Class modelling the fo:table-row object. See Sec. 6.7.9 of the XSL-FO
}
private KeepValue getKeepValue(String sPropName) {
- Property p = this.propertyList.get(sPropName);
+ int propId = FOPropertyMapping.getPropertyId(sPropName);
+ Property p = this.propertyList.get(propId);
Number n = p.getNumber();
if (n != null) {
return new KeepValue(KeepValue.KEEP_WITH_VALUE, n.intValue());
*/
public abstract class Region extends FObj {
- private static final String PROP_REGION_NAME = "region-name";
-
/** Key for before regions */
public static final String BEFORE = "before";
/** Key for start regions */
super.handleAttrs(attlist);
// regions may have name, or default
- if (null == this.propertyList.get(PROP_REGION_NAME)) {
+ if (null == this.propertyList.get(PR_REGION_NAME)) {
setRegionName(getDefaultRegionName());
- } else if (this.propertyList.get(PROP_REGION_NAME).getString().equals("")) {
+ } else if (this.propertyList.get(PR_REGION_NAME).getString().equals("")) {
setRegionName(getDefaultRegionName());
} else {
- setRegionName(this.propertyList.get(PROP_REGION_NAME).getString());
+ setRegionName(this.propertyList.get(PR_REGION_NAME).getString());
// check that name is OK. Not very pretty.
if (isReserved(getRegionName())
&& !getRegionName().equals(getDefaultRegionName())) {
- throw new FOPException(PROP_REGION_NAME + " '" + regionName
+ throw new FOPException("region-name '" + regionName
+ "' for " + this.name
+ " not permitted.");
}