super(propId);</xsl:text>
<xsl:if test="compound">
<xsl:text>
- m_shorthandMaker= getSubpropMaker("</xsl:text>
- <xsl:value-of select=
- 'compound/subproperty[@set-by-shorthand="true"]/name'/>
- <xsl:text>");</xsl:text>
+ m_shorthandMaker= getSubpropMaker(Constants.CP_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select=
+ 'compound/subproperty[@set-by-shorthand="true"]/name'/>
+ </xsl:call-template>
+ <xsl:text>);</xsl:text>
</xsl:if>
<xsl:text>
}
return true;
}
- protected Property.Maker getSubpropMaker(String subprop) {</xsl:text>
+ protected Property.Maker getSubpropMaker(int subpropId) {</xsl:text>
<xsl:for-each select="compound/subproperty">
<xsl:variable name="spname">
<xsl:call-template name="makeClassName">
</xsl:call-template>
</xsl:variable>
<xsl:text>
- if (subprop.equals("</xsl:text>
- <xsl:value-of select='name'/>
- <xsl:text>"))
+ if (subpropId == Constants.CP_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select="name"/>
+ </xsl:call-template>
+ <xsl:text>)
return s_</xsl:text>
<xsl:value-of select="$spname"/>
<xsl:text>Maker;</xsl:text>
</xsl:for-each>
<xsl:text>
- return super.getSubpropMaker(subprop);
+ return super.getSubpropMaker(subpropId);
}
protected Property setSubprop(Property baseProp, int subpropId,
// set default for subprop </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
- subProp = getSubpropMaker("</xsl:text>
- <xsl:value-of select='.'/>
- <xsl:text>").make(pList, getDefaultFor</xsl:text>
+ subProp = getSubpropMaker(Constants.CP_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select="."/>
+ </xsl:call-template>
+ <xsl:text>).make(pList, getDefaultFor</xsl:text>
<xsl:value-of select='$spname'/>
<xsl:text>(), fo);
p.setComponent(Constants.CP_</xsl:text>
* of compound property types, such as "space".
* Overridden by property maker subclasses which handle
* compound properties.
- * @param subprop The name of the component for which a Maker is to
- * returned, for example "optimum", if the FO attribute is
+ * @param subprop The Constants ID of the component for which a Maker is to
+ * returned, for example CP_OPTIMUM, if the FO attribute is
* space.optimum='10pt'.
* @return the Maker object specified
*/
- protected Maker getSubpropMaker(String subprop) {
+ protected Maker getSubpropMaker(int subpropId) {
return null;
}
if (baseProp == null) {
baseProp = makeCompound(propertyList, fo);
}
- Maker spMaker = getSubpropMaker(partName);
+ int partId = FOPropertyMapping.getSubPropertyId(partName);
+ Maker spMaker = getSubpropMaker(partId);
if (spMaker != null) {
Property p = spMaker.make(propertyList, value, fo);
if (p != null) {
- int partId = FOPropertyMapping.getSubPropertyId(partName);
return setSubprop(baseProp, partId, p);
}
} else {