aboutsummaryrefslogtreecommitdiffstats
path: root/src/codegen
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-01-02 23:53:09 +0000
committerGlen Mazza <gmazza@apache.org>2004-01-02 23:53:09 +0000
commit0222590e84a2b3b16baaeae6d6b68ee0a4f68881 (patch)
tree361326f6241278c3cebc0e1af73b29a789e71918 /src/codegen
parent2185a69b4b30b183b550853c3b2ba59ebfc7f39a (diff)
downloadxmlgraphics-fop-0222590e84a2b3b16baaeae6d6b68ee0a4f68881.tar.gz
xmlgraphics-fop-0222590e84a2b3b16baaeae6d6b68ee0a4f68881.zip
FOPropertyMapping.GetPropertyId() modified to also be able to return
(base + compound) ID value for a "base.compound" string; more String->Int conversions in Leader.java. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197097 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/fo-property-mapping.xsl25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/codegen/fo-property-mapping.xsl b/src/codegen/fo-property-mapping.xsl
index b4acb2c8b..3c8a504e6 100644
--- a/src/codegen/fo-property-mapping.xsl
+++ b/src/codegen/fo-property-mapping.xsl
@@ -137,10 +137,27 @@ public class <xsl:value-of select="@family"/>PropertyMapping implements Constant
}
public static int getPropertyId(String name) {
- Integer i = (Integer) s_htPropNames.get(name);
- if (i == null)
- return -1;
- return i.intValue();
+ // check to see if base.compound or just base property
+ int sepchar = name.indexOf('.');
+
+ if (sepchar > -1) {
+ Integer baseId = (Integer) s_htPropNames.get(name.substring(0, sepchar));
+ if (baseId == null) {
+ return -1;
+ } else {
+ int cmpdId = getSubPropertyId(name.substring(sepchar + 1));
+ if (cmpdId == -1) {
+ return -1;
+ } else {
+ return baseId.intValue() + cmpdId;
+ }
+ }
+ } else {
+ Integer baseId = (Integer) s_htPropNames.get(name);
+ if (baseId == null)
+ return -1;
+ return baseId.intValue();
+ }
}
public static int getSubPropertyId(String name) {