diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-02-28 10:00:46 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-02-28 10:00:46 +0000 |
commit | 17f7dbd53db372bdbd9e6155e2bd03836b9ffbe7 (patch) | |
tree | 27278260deda41c75a22dd159962395e8f2bee18 /src/java/org/apache | |
parent | 2e2d2e6cd25ff610b2221e14873ae68d8f9813f0 (diff) | |
download | xmlgraphics-fop-17f7dbd53db372bdbd9e6155e2bd03836b9ffbe7.tar.gz xmlgraphics-fop-17f7dbd53db372bdbd9e6155e2bd03836b9ffbe7.zip |
Fixed bug in handling of text-align-last. Value "relative" was not the default and the resolved property was wrong when it was inherited.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@381618 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/fo/FOPropertyMapping.java | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index 476810715..75d3b6f08 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -1688,31 +1688,45 @@ public class FOPropertyMapping implements Constants { // text-align-last m = new EnumProperty.Maker(PR_TEXT_ALIGN_LAST) { - public Property compute(PropertyList propertyList) throws PropertyException { - Property corresponding = propertyList.get(PR_TEXT_ALIGN); - if (corresponding == null) { - return null; - } - int correspondingValue = corresponding.getEnum(); - if (correspondingValue == EN_JUSTIFY) { - return getEnumProperty(EN_START, "START"); - } else if (correspondingValue == EN_END) { - return getEnumProperty(EN_END, "END"); - } else if (correspondingValue == EN_START) { - return getEnumProperty(EN_START, "START"); - } else if (correspondingValue == EN_CENTER) { - return getEnumProperty(EN_CENTER, "CENTER"); + public Property convertProperty(Property p, + PropertyList propertyList, + FObj fo) throws PropertyException { + int en = p.getEnum(); + if (en == EN_RELATIVE) { + Property corresponding = propertyList.get(PR_TEXT_ALIGN); + if (corresponding == null) { + return p; + } + int correspondingValue = corresponding.getEnum(); + if (correspondingValue == EN_JUSTIFY) { + return getEnumProperty(EN_START, "START"); + } else if (correspondingValue == EN_END) { + return getEnumProperty(EN_END, "END"); + } else if (correspondingValue == EN_START) { + return getEnumProperty(EN_START, "START"); + } else if (correspondingValue == EN_CENTER) { + return getEnumProperty(EN_CENTER, "CENTER"); + } else { + return p; + } } else { - return null; + return p; } } }; m.setInherited(true); + // Note: both 'end', 'right' and 'outside' are mapped to END + // both 'start', 'left' and 'inside' are mapped to START + m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE")); m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER")); m.addEnum("end", getEnumProperty(EN_END, "END")); + m.addEnum("right", getEnumProperty(EN_END, "END")); m.addEnum("start", getEnumProperty(EN_START, "START")); + m.addEnum("left", getEnumProperty(EN_START, "START")); m.addEnum("justify", getEnumProperty(EN_JUSTIFY, "JUSTIFY")); - m.setDefault("start"); + m.addEnum("inside", getEnumProperty(EN_START, "START")); + m.addEnum("outside", getEnumProperty(EN_END, "END")); + m.setDefault("relative", true); addPropertyMaker("text-align-last", m); // text-indent |