Index: fop =================================================================== --- fop (revision 488651) +++ fop (working copy) @@ -243,6 +243,11 @@ # Execute FOP using eval/exec to preserve spaces in paths, # java options, and FOP args + +# Add the following options for extra debug: +# JMP: -Xrunjmp +# Hat: -Xrunhprof:file=dump.hprof,format=b + fop_exec_command="exec \"$JAVACMD\" $LOGCHOICE $LOGLEVEL -classpath \"$LOCALCLASSPATH\" $FOP_OPTS org.apache.fop.cli.Main $fop_exec_args" if $fop_exec_debug ; then echo $fop_exec_command Index: src/java/org/apache/fop/render/txt/TXTHandler.java =================================================================== --- src/java/org/apache/fop/render/txt/TXTHandler.java (revision 488651) +++ src/java/org/apache/fop/render/txt/TXTHandler.java (working copy) @@ -107,7 +107,7 @@ * @param value new integer value */ private static void setLength(CompoundDatatype cd, int value) { - cd.setComponent(Constants.CP_LENGTH, new FixedLength(value), true); + cd.setComponent(Constants.CP_LENGTH, FixedLength.getInstance(value), true); } /** @@ -193,7 +193,7 @@ */ private void modifySpace(SpaceProperty space, int q) { int value = space.getOptimum(null).getLength().getValue(); - setMinOptMax(space, new FixedLength(Helper.round(value, q))); + setMinOptMax(space, FixedLength.getInstance(Helper.round(value, q))); } /** @@ -204,7 +204,7 @@ */ private Length roundLength(Length length, int q) { int x = Helper.round(length.getValue(), q); - return new FixedLength(x); + return FixedLength.getInstance(x); } /** @@ -215,7 +215,7 @@ */ private Length ceilLength(Length length, int q) { int x = Helper.ceil(length.getValue(), q); - return new FixedLength(x); + return FixedLength.getInstance(x); } /** @@ -233,7 +233,7 @@ } int newValue = indent.getValue() + overPatching[side]; newValue = Helper.round(newValue, quantum[side]); - return new FixedLength(newValue); + return FixedLength.getInstance(newValue); } /** @@ -283,7 +283,7 @@ // impove interaction with other FO. int value = cmb.spaceAfter.getOptimum(null).getLength().getValue(); value += TXTRenderer.CHAR_HEIGHT; - setMinOptMax(cmb.spaceAfter, new FixedLength(value)); + setMinOptMax(cmb.spaceAfter, FixedLength.getInstance(value)); } modifyCommonMarginBlock(cmb); @@ -352,10 +352,11 @@ * @param cap CommonAbsolutePosition to modify. */ private void modifyCommonAbsolutePosition(CommonAbsolutePosition cap) { - if (cap.absolutePosition == Constants.EN_ABSOLUTE) { - cap.left = roundLength(cap.left, TXTRenderer.CHAR_WIDTH); - cap.top = roundLength(cap.top, TXTRenderer.CHAR_HEIGHT); - } + // TODO: Broken since CommonAbsolutePosition made immutable +// if (cap.absolutePosition == Constants.EN_ABSOLUTE) { +// cap.left = roundLength(cap.left, TXTRenderer.CHAR_WIDTH); +// cap.top = roundLength(cap.top, TXTRenderer.CHAR_HEIGHT); +// } } /** @@ -370,7 +371,7 @@ int height = TXTRenderer.CHAR_HEIGHT; int newValue = Math.max(Helper.floor(value, height), height); - setMinOptMax(lineHeight, new FixedLength(newValue)); + setMinOptMax(lineHeight, FixedLength.getInstance(newValue)); } /** @@ -385,12 +386,13 @@ * @param cf the font to modify. */ private void modifyCommonFont(CommonFont cf) { - if (cf != null) { - cf.overrideFontFamily("Courier"); - cf.fontSize = new FixedLength(MODIFIED_FONT_SIZE); - cf.fontStretch = Constants.EN_NORMAL; - cf.fontWeight = Constants.EN_NORMAL; - } + // TODO: Broken since CommonFont made immutable +// if (cf != null) { +// cf.overrideFontFamily("Courier"); +// cf.fontSize = new FixedLength(MODIFIED_FONT_SIZE); +// cf.fontStretch = Constants.EN_NORMAL; +// cf.fontWeight = Constants.EN_NORMAL; +// } } /** Index: src/java/org/apache/fop/fo/properties/CommonHyphenation.java =================================================================== --- src/java/org/apache/fop/fo/properties/CommonHyphenation.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/CommonHyphenation.java (working copy) @@ -29,46 +29,49 @@ * Public "structure" allows direct member access. */ public class CommonHyphenation { + + private static final PropertyCache cache = new PropertyCache(); + /** * The "language" property. */ - public String language; + public final String language; /** * The "country" property. */ - public String country; + public final String country; /** * The "script" property. */ - public String script; + public final String script; /** * The "hyphenate" property. */ - public int hyphenate; + public final int hyphenate; /** * The "hyphenation-character" property. */ - public char hyphenationCharacter; + public final char hyphenationCharacter; /** * The "hyphenation-push-character" property. */ - public int hyphenationPushCharacterCount; + public final int hyphenationPushCharacterCount; /** * The "hyphenation-remain-character-count" property. */ - public int hyphenationRemainCharacterCount; + public final int hyphenationRemainCharacterCount; /** * Create a CommonHyphenation object. - * @param pList The PropertyList with propery values. + * @param pList The PropertyList with property values. */ - public CommonHyphenation(PropertyList pList) throws PropertyException { + private CommonHyphenation(PropertyList pList) throws PropertyException { language = pList.get(Constants.PR_LANGUAGE).getString(); country = pList.get(Constants.PR_COUNTRY).getString(); script = pList.get(Constants.PR_SCRIPT).getString(); @@ -81,4 +84,26 @@ } + public int hashCode() { + return Property.hc(language) << 1 + + Property.hc(country) << 4 + + Property.hc(script) << 9 + + hyphenate; + } + + public boolean equals(Object obj) { + CommonHyphenation c = (CommonHyphenation)obj; + return Property.eq(language, language) && + Property.eq(country, country) && + Property.eq(script, script) && + hyphenate == c.hyphenate && + hyphenationCharacter == c.hyphenationCharacter && + hyphenationPushCharacterCount == c.hyphenationPushCharacterCount && + hyphenationRemainCharacterCount == c.hyphenationRemainCharacterCount; + } + + public static CommonHyphenation getInstance(PropertyList pList) throws PropertyException { + CommonHyphenation c = new CommonHyphenation(pList); + return (CommonHyphenation)cache.fetch(c); + } } Index: src/java/org/apache/fop/fo/properties/CommonAccessibility.java =================================================================== --- src/java/org/apache/fop/fo/properties/CommonAccessibility.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/CommonAccessibility.java (working copy) @@ -28,32 +28,44 @@ * See Sec 7.4 of the XSL-FO Standard. * Public "structure" allows direct member access. */ -public class CommonAccessibility { +public final class CommonAccessibility { + + private static final PropertyCache cache = new PropertyCache(); + /** * The "source-doc" property. */ - public String sourceDoc = null; + public final String sourceDoc; /** * The "role" property. */ - public String role = null; + public final String role; /** * Create a CommonAbsolutePosition object. * @param pList The PropertyList with propery values. */ - public CommonAccessibility(PropertyList pList) throws PropertyException { - sourceDoc = pList.get(Constants.PR_SOURCE_DOCUMENT).getString(); - if ("none".equals(sourceDoc)) { - sourceDoc = null; - } - role = pList.get(Constants.PR_ROLE).getString(); - if ("none".equals(role)) { - role = null; - } - + private CommonAccessibility(PropertyList pList) throws PropertyException { + String s = pList.get(Constants.PR_SOURCE_DOCUMENT).getString(); + sourceDoc = ("none".equals(s)) ? null : s; + String r = pList.get(Constants.PR_ROLE).getString(); + role = ("none".equals(r)) ? null : r; } + public int hashCode() { + return sourceDoc == null ? 0 : sourceDoc.hashCode() + + role == null ? 0 : role.hashCode() << 1; + } + public boolean equals(Object obj) { + CommonAccessibility ca = (CommonAccessibility)obj; + return Property.eq(ca.sourceDoc, this.sourceDoc) && + Property.eq(ca.role, this.role); + } + + public static CommonAccessibility getInstance(PropertyList pList) throws PropertyException { + CommonAccessibility ca = new CommonAccessibility(pList); + return (CommonAccessibility)cache.fetch(ca); + } } Index: src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java =================================================================== --- src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java (working copy) @@ -63,7 +63,7 @@ // Calculate the values as described in 7.7.20. Property style = propertyList.get(borderStyleId); if (style.getEnum() == Constants.EN_NONE) { - return new FixedLength(0); + return FixedLength.getInstance(0); } return p; } Index: src/java/org/apache/fop/fo/properties/LengthRangeProperty.java =================================================================== --- src/java/org/apache/fop/fo/properties/LengthRangeProperty.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/LengthRangeProperty.java (working copy) @@ -84,7 +84,7 @@ log.warn(FObj.decorateWithContextInfo( "Replaced negative value (" + len + ") for " + getName() + " with 0mpt", fo)); - p = new FixedLength(0); + p = FixedLength.getInstance(0); } } } @@ -106,8 +106,7 @@ if (isNegativeLength(len)) { log.warn("Replaced negative value (" + len + ") for " + getName() + " with 0mpt"); - val.setComponent(subpropertyId, - new FixedLength(0), false); + val.setComponent(subpropertyId, FixedLength.getInstance(0), false); return baseProperty; } } Index: src/java/org/apache/fop/fo/properties/EnumProperty.java =================================================================== --- src/java/org/apache/fop/fo/properties/EnumProperty.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/EnumProperty.java (working copy) @@ -62,18 +62,24 @@ } } - private int value; - private String text; + private static final PropertyCache cache = new PropertyCache(); + private final int value; + private final String text; + /** * @param explicitValue enumerated value to be set for this property * @param text the string value of the enum. */ - public EnumProperty(int explicitValue, String text) { + private EnumProperty(int explicitValue, String text) { this.value = explicitValue; this.text = text; } + public static EnumProperty getInstance(int explicitValue, String text) { + return (EnumProperty)cache.fetch(new EnumProperty(explicitValue, text)); + } + /** * @return this.value */ @@ -88,5 +94,13 @@ return text; } + public boolean equals(Object obj) { + EnumProperty ep = (EnumProperty)obj; + return value == ep.value && Property.eq(text, ep.text); + } + + public int hashCode() { + return value + text.hashCode(); + } } Index: src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java =================================================================== --- src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java (working copy) @@ -49,11 +49,11 @@ || propId == Constants.PR_BREAK_AFTER) { switch (property.getEnum()) { case Constants.EN_ALWAYS: - return new EnumProperty(Constants.EN_PAGE, "PAGE"); + return EnumProperty.getInstance(Constants.EN_PAGE, "PAGE"); case Constants.EN_LEFT: - return new EnumProperty(Constants.EN_EVEN_PAGE, "EVEN_PAGE"); + return EnumProperty.getInstance(Constants.EN_EVEN_PAGE, "EVEN_PAGE"); case Constants.EN_RIGHT: - return new EnumProperty(Constants.EN_ODD_PAGE, "ODD_PAGE"); + return EnumProperty.getInstance(Constants.EN_ODD_PAGE, "ODD_PAGE"); case Constants.EN_AVOID: default: //nop; Index: src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java =================================================================== --- src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java (working copy) @@ -40,101 +40,101 @@ case EN_BASELINE: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_BASELINE, "BASELINE"); + return EnumProperty.getInstance(EN_BASELINE, "BASELINE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE")); + return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } case EN_TOP: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE"); + return EnumProperty.getInstance(EN_BEFORE_EDGE, "BEFORE_EDGE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE")); + return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } case EN_TEXT_TOP: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"); + return EnumProperty.getInstance(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE")); + return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } case EN_MIDDLE: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_MIDDLE, "MIDDLE"); + return EnumProperty.getInstance(EN_MIDDLE, "MIDDLE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE")); + return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } case EN_BOTTOM: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_AFTER_EDGE, "AFTER_EDGE"); + return EnumProperty.getInstance(EN_AFTER_EDGE, "AFTER_EDGE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE")); + return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } case EN_TEXT_BOTTOM: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"); + return EnumProperty.getInstance(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE")); + return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } case EN_SUB: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_BASELINE, "BASELINE"); + return EnumProperty.getInstance(EN_BASELINE, "BASELINE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_SUB, "SUB")); + return new EnumLength(EnumProperty.getInstance(EN_SUB, "SUB")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } case EN_SUPER: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_BASELINE, "BASELINE"); + return EnumProperty.getInstance(EN_BASELINE, "BASELINE"); case PR_ALIGNMENT_ADJUST: - return new EnumLength(new EnumProperty(EN_AUTO, "AUTO")); + return new EnumLength(EnumProperty.getInstance(EN_AUTO, "AUTO")); case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_SUPER, "SUPER")); + return new EnumLength(EnumProperty.getInstance(EN_SUPER, "SUPER")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } default: switch (propId) { case PR_ALIGNMENT_BASELINE: - return new EnumProperty(EN_BASELINE, "BASELINE"); + return EnumProperty.getInstance(EN_BASELINE, "BASELINE"); case PR_ALIGNMENT_ADJUST: return property; case PR_BASELINE_SHIFT: - return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE")); + return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: - return new EnumProperty(EN_AUTO, "AUTO"); + return EnumProperty.getInstance(EN_AUTO, "AUTO"); } } return null; Index: src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java =================================================================== --- src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java (working copy) @@ -30,30 +30,33 @@ * Public "structure" allows direct member access. */ public class CommonAbsolutePosition { + + private static final PropertyCache cache = new PropertyCache(); + /** * The "absolute-position" property. */ - public int absolutePosition; + public final int absolutePosition; /** * The "top" property. */ - public Length top; + public final Length top; /** * The "right" property. */ - public Length right; + public final Length right; /** * The "bottom" property. */ - public Length bottom; + public final Length bottom; /** * The "left" property. */ - public Length left; + public final Length left; /** * Create a CommonAbsolutePosition object. @@ -82,4 +85,27 @@ sb.append("}"); return sb.toString(); } + + public int hashCode() { + return absolutePosition + + Property.hc(top) << 2 + + Property.hc(right) << 4 + + Property.hc(bottom) << 6 + + Property.hc(left) << 8; + } + + public boolean equals(Object obj) { + CommonAbsolutePosition cap = (CommonAbsolutePosition)obj; + return cap.absolutePosition == absolutePosition && + Property.eq(cap.top, top) && + Property.eq(cap.right, right) && + Property.eq(cap.bottom, bottom) && + Property.eq(cap.left, left); + } + + public static CommonAbsolutePosition getInstance(PropertyList pList) throws PropertyException { + CommonAbsolutePosition cap = new CommonAbsolutePosition(pList); + return (CommonAbsolutePosition)cache.fetch(cap); + } + } Index: src/java/org/apache/fop/fo/properties/EnumNumber.java =================================================================== --- src/java/org/apache/fop/fo/properties/EnumNumber.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/EnumNumber.java (working copy) @@ -19,17 +19,32 @@ package org.apache.fop.fo.properties; +import java.util.Map; +import java.util.WeakHashMap; + /** * A number quantity in XSL which is specified as an enum, such as "no-limit". */ public class EnumNumber extends NumberProperty { - private Property enumProperty; + + private static final Map cache = new WeakHashMap(); + + private final EnumProperty enumProperty; - public EnumNumber(Property enumProperty) { + private EnumNumber(EnumProperty enumProperty) { super(null); this.enumProperty = enumProperty; } + public static EnumNumber getInstance(Property enumProperty) { + EnumNumber en = (EnumNumber)cache.get(enumProperty); + if (en == null) { + en = new EnumNumber((EnumProperty)enumProperty); + cache.put(enumProperty, en); + } + return en; + } + public int getEnum() { return enumProperty.getEnum(); } Index: src/java/org/apache/fop/fo/properties/Property.java =================================================================== --- src/java/org/apache/fop/fo/properties/Property.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/Property.java (working copy) @@ -199,4 +199,17 @@ } return null; } + + /** + Utility method which returns true iff obj1.equals(obj2) + or obj1 and obj2 are both null. + */ + static final boolean eq(Object obj1, Object obj2) { + return (obj1 == obj2) || + (obj1 != null && obj2 != null && obj1.equals(obj2)); + } + + static final int hc(Object obj) { + return obj == null ? 0 : obj.hashCode(); + } } Index: src/java/org/apache/fop/fo/properties/PositionShorthandParser.java =================================================================== --- src/java/org/apache/fop/fo/properties/PositionShorthandParser.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/PositionShorthandParser.java (working copy) @@ -41,11 +41,11 @@ switch (propVal) { case Constants.EN_STATIC: case Constants.EN_RELATIVE: - return new EnumProperty(Constants.EN_AUTO, "AUTO"); + return EnumProperty.getInstance(Constants.EN_AUTO, "AUTO"); case Constants.EN_ABSOLUTE: - return new EnumProperty(Constants.EN_ABSOLUTE, "ABSOLUTE"); + return EnumProperty.getInstance(Constants.EN_ABSOLUTE, "ABSOLUTE"); case Constants.EN_FIXED: - return new EnumProperty(Constants.EN_FIXED, "FIXED"); + return EnumProperty.getInstance(Constants.EN_FIXED, "FIXED"); default: //nop } @@ -53,13 +53,13 @@ if (propId == Constants.PR_RELATIVE_POSITION) { switch (propVal) { case Constants.EN_STATIC: - return new EnumProperty(Constants.EN_STATIC, "STATIC"); + return EnumProperty.getInstance(Constants.EN_STATIC, "STATIC"); case Constants.EN_RELATIVE: - return new EnumProperty(Constants.EN_RELATIVE, "RELATIVE"); + return EnumProperty.getInstance(Constants.EN_RELATIVE, "RELATIVE"); case Constants.EN_ABSOLUTE: - return new EnumProperty(Constants.EN_STATIC, "STATIC"); + return EnumProperty.getInstance(Constants.EN_STATIC, "STATIC"); case Constants.EN_FIXED: - return new EnumProperty(Constants.EN_STATIC, "STATIC"); + return EnumProperty.getInstance(Constants.EN_STATIC, "STATIC"); default: //nop } Index: src/java/org/apache/fop/fo/properties/NumberProperty.java =================================================================== --- src/java/org/apache/fop/fo/properties/NumberProperty.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/NumberProperty.java (working copy) @@ -58,7 +58,7 @@ return p; } if (p instanceof EnumProperty) { - return new EnumNumber(p); + return EnumNumber.getInstance(p); } Number val = p.getNumber(); if (val != null) { @@ -172,7 +172,7 @@ /** @see org.apache.fop.fo.properties.Property#getLength() */ public Length getLength() { //Assume pixels (like in HTML) when there's no unit - return new FixedLength(getNumericValue(), "px"); + return FixedLength.getInstance(getNumericValue(), "px"); } /** Index: src/java/org/apache/fop/fo/properties/FixedLength.java =================================================================== --- src/java/org/apache/fop/fo/properties/FixedLength.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/FixedLength.java (working copy) @@ -25,31 +25,45 @@ * An absolute length quantity in XSL */ public class FixedLength extends LengthProperty { + + private static final PropertyCache cache = new PropertyCache(); + private int millipoints; + private FixedLength(int millis) { + millipoints = millis; + } + /** - * Set the length given + * Obtain an instance given a number of units and a font size. * @param numRelUnits the number of relative units * @param iCurFontSize the current font size in base units. + * @return A new or previously cached instance of FixedLength */ - public FixedLength(double numRelUnits, int iCurFontSize) { - millipoints = (int) (numRelUnits * (double)iCurFontSize); + public static FixedLength getInstance(double numRelUnits, int iCurFontSize) { + FixedLength fl = new FixedLength((int) (numRelUnits * (double)iCurFontSize)); + return (FixedLength)cache.fetch(fl); } /** - * Set the length given a number of units and a unit name. + * Obtain an instance given a number of units and a unit name. * @param numUnits quantity of input units * @param units input unit specifier (in, cm, etc.) + * @return A new or previously cached instance of FixedLength */ - public FixedLength(double numUnits, String units) { - convert(numUnits, units); + public static FixedLength getInstance(double numUnits, String units) { + FixedLength fl = new FixedLength(convert(numUnits, units)); + return (FixedLength)cache.fetch(fl); } /** + * Obtain an instance given a number of units. * @param baseUnits the length as a number of base units (millipoints) + * @return A new or previously cached instance of FixedLength */ - public FixedLength(int baseUnits) { - millipoints = baseUnits; + public static FixedLength getInstance(int baseUnits) { + FixedLength fl = new FixedLength(baseUnits); + return (FixedLength)cache.fetch(fl); } /** @@ -58,7 +72,7 @@ * @param dvalue quantity of input units * @param unit input unit specifier (in, cm, etc.) */ - protected void convert(double dvalue, String unit) { + private static int convert(double dvalue, String unit) { // TODO: the whole routine smells fishy. int assumedResolution = 1; // points/pixel = 72dpi @@ -90,9 +104,9 @@ log.error("Unknown length unit '" + unit + "'"); } if (unit.equals("mpt")) { - millipoints = (int)dvalue; + return (int)dvalue; } else { - millipoints = (int)(dvalue * 1000); + return (int)(dvalue * 1000); } } @@ -139,5 +153,14 @@ return millipoints + "mpt"; } + public boolean equals(Object obj) { + FixedLength fl = (FixedLength)obj; + return millipoints == fl.millipoints; + } + + public int hashCode() { + return millipoints; + } + } Index: src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java =================================================================== --- src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java (working copy) @@ -54,9 +54,9 @@ */ Property p = super.make(propertyList, value, fo); p.getSpace().setConditionality( - new EnumProperty(Constants.EN_RETAIN, "RETAIN"), true); + EnumProperty.getInstance(Constants.EN_RETAIN, "RETAIN"), true); p.getSpace().setPrecedence( - new EnumProperty(Constants.EN_FORCE, "FORCE"), true); + EnumProperty.getInstance(Constants.EN_FORCE, "FORCE"), true); return p; } Index: src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java =================================================================== --- src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java (working copy) @@ -108,7 +108,7 @@ //Margin is used Numeric margin = propertyList.get(marginProp).getNumeric(); - Numeric v = new FixedLength(0); + Numeric v = FixedLength.getInstance(0); if (!propertyList.getFObj().generatesReferenceAreas()) { // The inherited_value_of([start|end]-indent) v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric()); @@ -173,7 +173,7 @@ if (isInherited(propertyList) || !marginNearest) { return null; } else { - return new FixedLength(0); + return FixedLength.getInstance(0); } } else { return indent; @@ -182,7 +182,7 @@ //Margin is used Numeric margin = propertyList.get(marginProp).getNumeric(); - Numeric v = new FixedLength(0); + Numeric v = FixedLength.getInstance(0); if (isInherited(propertyList)) { // The inherited_value_of([start|end]-indent) v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric()); Index: src/java/org/apache/fop/fo/properties/CommonRelativePosition.java =================================================================== --- src/java/org/apache/fop/fo/properties/CommonRelativePosition.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/CommonRelativePosition.java (working copy) @@ -30,30 +30,33 @@ * Public "structure" allows direct member access. */ public class CommonRelativePosition { + + private static final PropertyCache cache = new PropertyCache(); + /** * The "relative-position" property. */ - public int relativePosition; + public final int relativePosition; /** * The "top" property. */ - public Length top; + public final Length top; /** * The "right" property. */ - public Length right; + public final Length right; /** * The "bottom" property. */ - public Length bottom; + public final Length bottom; /** * The "left" property. */ - public Length left; + public final Length left; /** * Create a CommonRelativePosition object. @@ -67,4 +70,25 @@ right = pList.get(Constants.PR_RIGHT).getLength(); } + public int hashCode() { + return relativePosition + + Property.hc(top) << 2 + + Property.hc(right) << 4 + + Property.hc(bottom) << 6 + + Property.hc(left) << 8; + } + + public boolean equals(Object obj) { + CommonRelativePosition c = (CommonRelativePosition)obj; + return c.relativePosition == relativePosition && + Property.eq(c.top, top) && + Property.eq(c.right, right) && + Property.eq(c.bottom, bottom) && + Property.eq(c.left, left); + } + + public static CommonRelativePosition getInstance(PropertyList pList) throws PropertyException { + CommonRelativePosition c = new CommonRelativePosition(pList); + return (CommonRelativePosition)cache.fetch(c); + } } Index: src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java =================================================================== --- src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java (working copy) @@ -405,4 +405,25 @@ return (borderInfo[BEFORE] != null || borderInfo[AFTER] != null || borderInfo[START] != null || borderInfo[END] != null); } + + public int hashCode() { + return Property.hc(backgroundColor) << 1 + + Property.hc(backgroundImage) << 3 + + backgroundRepeat << 5 + + Property.hc(backgroundPositionHorizontal) << 7 + + Property.hc(backgroundPositionVertical); + } + + public boolean equals(Object obj) { + CommonBorderPaddingBackground c = (CommonBorderPaddingBackground)obj; + return backgroundAttachment == c.backgroundAttachment && + backgroundRepeat == c.backgroundRepeat && + Property.eq(backgroundColor, c.backgroundColor) && + Property.eq(backgroundImage, c.backgroundColor) && + Property.eq(backgroundPositionHorizontal, c.backgroundPositionHorizontal) && + Property.eq(backgroundPositionVertical, c.backgroundPositionVertical) && + (fopimage == c.fopimage || + (fopimage!=null && + fopimage.getOriginalURI().equals(c.fopimage.getOriginalURI()))); + } } Index: src/java/org/apache/fop/fo/properties/CommonAural.java =================================================================== --- src/java/org/apache/fop/fo/properties/CommonAural.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/CommonAural.java (working copy) @@ -121,6 +121,13 @@ * Create a CommonAbsolutePosition object. * @param pList The PropertyList with propery values. */ - public CommonAural(PropertyList pList) { + private CommonAural(PropertyList pList) { } + + /** + Placeholder. See CommonAccessibility for the correct instantiation idiom. + */ + public static CommonAural getInstance(PropertyList pList) { + return null; + } } Index: src/java/org/apache/fop/fo/properties/CommonFont.java =================================================================== --- src/java/org/apache/fop/fo/properties/CommonFont.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/CommonFont.java (working copy) @@ -38,45 +38,47 @@ */ public class CommonFont { + private static final PropertyCache cache = new PropertyCache(); + /** * The "font-family" property. */ - private String[] fontFamily; + private final String[] fontFamily; /** * The "font-selection-strategy" property. */ - public int fontSelectionStrategy; + public final int fontSelectionStrategy; /** * The "font-size" property. */ - public Length fontSize; + public final Length fontSize; /** * The "font-stretch" property. */ - public int fontStretch; + public final int fontStretch; /** * The "font-size-adjust" property. */ - public Numeric fontSizeAdjust; + public final Numeric fontSizeAdjust; /** * The "font-style" property. */ - public int fontStyle; + public final int fontStyle; /** * The "font-variant" property. */ - public int fontVariant; + public final int fontVariant; /** * The "font-weight" property. */ - public int fontWeight; + public final int fontWeight; private Font fontState; @@ -84,15 +86,17 @@ * Create a CommonFont object. * @param pList The PropertyList to get properties from. */ - public CommonFont(PropertyList pList) throws PropertyException { + private CommonFont(PropertyList pList) throws PropertyException { List lst = pList.get(Constants.PR_FONT_FAMILY).getList(); - fontFamily = new String[lst.size()]; - for (int i = 0, c = lst.size(); i < c; i++) { - fontFamily[i] = ((Property)lst.get(i)).getString(); - } - if (fontFamily.length == 0) { + int lstSize = lst.size(); + if (lstSize == 0) { //Shouldn't happen, but we never know. fontFamily = new String[] {"any"}; + } else { + fontFamily = new String[lstSize]; + for (int i = 0, c = lstSize; i < c; i++) { + fontFamily[i] = ((Property)lst.get(i)).getString(); + } } fontSelectionStrategy = pList.get(Constants.PR_FONT_SELECTION_STRATEGY).getEnum(); fontSize = pList.get(Constants.PR_FONT_SIZE).getLength(); @@ -103,6 +107,11 @@ fontWeight = pList.get(Constants.PR_FONT_WEIGHT).getEnum(); } + public static CommonFont getInstance(PropertyList pList) throws PropertyException { + CommonFont cf = new CommonFont(pList); + return (CommonFont)cache.fetch(cf); + } + /** @return the first font-family name in the list */ public String getFirstFontFamily() { return this.fontFamily[0]; @@ -114,15 +123,6 @@ } /** - * Overrides the font-family. - * @param value the new font-family - */ - public void overrideFontFamily(String value) { - this.fontFamily = new String[] {value}; - - } - - /** * Create and return a Font object based on the properties. * * @param fontInfo @@ -175,4 +175,26 @@ return fontState; } + public int hashCode() { + return fontStretch + fontStyle + fontVariant + fontWeight; + } + + public boolean equals(Object obj) { + CommonFont cf = (CommonFont)obj; + if (fontSelectionStrategy != cf.fontSelectionStrategy || + fontStretch != cf.fontStretch || + fontStyle != cf.fontStyle || + fontVariant != cf.fontVariant || + fontWeight != cf.fontWeight || + fontFamily.length != cf.fontFamily.length || + ! Property.eq(fontSize, cf.fontSize) || + ! Property.eq(fontSizeAdjust, cf.fontSizeAdjust)) + return false; + for (int i = 0; i < fontFamily.length; i++) { + if (!fontFamily[i].equals(cf.fontFamily[i])) { + return false; + } + } + return true; + } } Index: src/java/org/apache/fop/fo/properties/SpacePropertyMaker.java =================================================================== --- src/java/org/apache/fop/fo/properties/SpacePropertyMaker.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/SpacePropertyMaker.java (working copy) @@ -43,7 +43,7 @@ Property prop = super.compute(propertyList); if (prop != null && prop instanceof SpaceProperty) { ((SpaceProperty)prop).setConditionality( - new EnumProperty(Constants.EN_RETAIN, "RETAIN"), false); + EnumProperty.getInstance(Constants.EN_RETAIN, "RETAIN"), false); } return prop; } Index: src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java =================================================================== --- src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java (working copy) @@ -42,17 +42,17 @@ switch (propId) { case Constants.PR_LINEFEED_TREATMENT: case Constants.PR_WHITE_SPACE_TREATMENT: - return new EnumProperty(Constants.EN_PRESERVE, "PRESERVE"); + return EnumProperty.getInstance(Constants.EN_PRESERVE, "PRESERVE"); case Constants.PR_WHITE_SPACE_COLLAPSE: - return new EnumProperty(Constants.EN_FALSE, "FALSE"); + return EnumProperty.getInstance(Constants.EN_FALSE, "FALSE"); case Constants.PR_WRAP_OPTION: - return new EnumProperty(Constants.EN_NO_WRAP, "NO_WRAP"); + return EnumProperty.getInstance(Constants.EN_NO_WRAP, "NO_WRAP"); default: //nop } case Constants.EN_NO_WRAP: if (propId == Constants.PR_WRAP_OPTION) { - return new EnumProperty(Constants.EN_NO_WRAP, "NO_WRAP"); + return EnumProperty.getInstance(Constants.EN_NO_WRAP, "NO_WRAP"); } case Constants.EN_NORMAL: default: Index: src/java/org/apache/fop/fo/properties/LengthProperty.java =================================================================== --- src/java/org/apache/fop/fo/properties/LengthProperty.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/LengthProperty.java (working copy) @@ -59,7 +59,7 @@ } if (p instanceof NumberProperty) { //Assume pixels (like in HTML) when there's no unit - return new FixedLength(p.getNumeric().getNumericValue(), "px"); + return FixedLength.getInstance(p.getNumeric().getNumericValue(), "px"); } Length val = p.getLength(); if (val != null) { Index: src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java =================================================================== --- src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java (revision 488651) +++ src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java (working copy) @@ -55,9 +55,9 @@ Property pp = propertyList.getFromParent(this.getPropId()); int baseFontSize = computeClosestAbsoluteFontSize(pp.getLength().getValue()); if (p.getEnum() == EN_LARGER) { - return new FixedLength((int)Math.round((baseFontSize * FONT_SIZE_GROWTH_FACTOR))); + return FixedLength.getInstance((int)Math.round((baseFontSize * FONT_SIZE_GROWTH_FACTOR))); } else { - return new FixedLength((int)Math.round((baseFontSize / FONT_SIZE_GROWTH_FACTOR))); + return FixedLength.getInstance((int)Math.round((baseFontSize / FONT_SIZE_GROWTH_FACTOR))); } } return super.convertProperty(p, propertyList, fo); Index: src/java/org/apache/fop/fo/PropertyList.java =================================================================== --- src/java/org/apache/fop/fo/PropertyList.java (revision 488651) +++ src/java/org/apache/fop/fo/PropertyList.java (working copy) @@ -583,7 +583,7 @@ * @throws PropertyException if there's a problem while processing the properties */ public CommonHyphenation getHyphenationProps() throws PropertyException { - return new CommonHyphenation(this); + return CommonHyphenation.getInstance(this); } /** @@ -610,7 +610,7 @@ * @throws PropertyException if there's a problem while processing the properties */ public CommonAccessibility getAccessibilityProps() throws PropertyException { - return new CommonAccessibility(this); + return CommonAccessibility.getInstance(this); } /** @@ -619,8 +619,7 @@ * @throws PropertyException if there's a problem while processing the properties */ public CommonAural getAuralProps() throws PropertyException { - CommonAural props = new CommonAural(this); - return props; + return CommonAural.getInstance(this); } /** @@ -629,7 +628,7 @@ * @throws PropertyException if there's a problem while processing the properties */ public CommonRelativePosition getRelativePositionProps() throws PropertyException { - return new CommonRelativePosition(this); + return CommonRelativePosition.getInstance(this); } /** @@ -638,7 +637,7 @@ * @throws PropertyException if there's a problem while processing the properties */ public CommonAbsolutePosition getAbsolutePositionProps() throws PropertyException { - return new CommonAbsolutePosition(this); + return CommonAbsolutePosition.getInstance(this); } @@ -648,7 +647,7 @@ * @throws PropertyException if there's a problem while processing the properties */ public CommonFont getFontProps() throws PropertyException { - return new CommonFont(this); + return CommonFont.getInstance(this); } /** Index: src/java/org/apache/fop/fo/FOPropertyMapping.java =================================================================== --- src/java/org/apache/fop/fo/FOPropertyMapping.java (revision 488651) +++ src/java/org/apache/fop/fo/FOPropertyMapping.java (working copy) @@ -265,7 +265,7 @@ enums = new Property[ENUM_COUNT + 1]; } if (enums[enumValue] == null) { - enums[enumValue] = new EnumProperty(enumValue, text); + enums[enumValue] = EnumProperty.getInstance(enumValue, text); } return enums[enumValue]; } Index: src/java/org/apache/fop/fo/flow/BasicLink.java =================================================================== --- src/java/org/apache/fop/fo/flow/BasicLink.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/BasicLink.java (working copy) @@ -36,7 +36,6 @@ public class BasicLink extends Inline { // The value of properties relevant for fo:basic-link. // private ToBeImplementedProperty destinationPlacementOffset; - private int dominantBaseline; private String externalDestination; // private ToBeImplementedProperty indicateDestination; private String internalDestination; @@ -44,6 +43,8 @@ // private ToBeImplementedProperty targetProcessingContext; // private ToBeImplementedProperty targetPresentationContext; // private ToBeImplementedProperty targetStylesheet; + // Unused but valid items, commented out for performance: + // private int dominantBaseline; // End of property values // used only for FO validation @@ -62,7 +63,6 @@ public void bind(PropertyList pList) throws FOPException { super.bind(pList); // destinationPlacementOffset = pList.get(PR_DESTINATION_PLACEMENT_OFFSET); - dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); externalDestination = pList.get(PR_EXTERNAL_DESTINATION).getString(); // indicateDestination = pList.get(PR_INDICATE_DESTINATION); internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString(); Index: src/java/org/apache/fop/fo/flow/AbstractListItemPart.java =================================================================== --- src/java/org/apache/fop/fo/flow/AbstractListItemPart.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/AbstractListItemPart.java (working copy) @@ -34,9 +34,10 @@ */ public abstract class AbstractListItemPart extends FObj { // The value of properties relevant for fo:list-item-label and fo:list-item-body. - private CommonAccessibility commonAccessibility; private String id; private KeepProperty keepTogether; + // Valid properties, commented out for performance: + // private CommonAccessibility commonAccessibility; // End of property values /** used for FO validation */ @@ -53,7 +54,6 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); id = pList.get(PR_ID).getString(); keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); } Index: src/java/org/apache/fop/fo/flow/TableColumn.java =================================================================== --- src/java/org/apache/fop/fo/flow/TableColumn.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/TableColumn.java (working copy) @@ -42,7 +42,8 @@ private Length columnWidth; private int numberColumnsRepeated; private int numberColumnsSpanned; - private int visibility; + // Unused but valid items, commented out for performance: + // private int visibility; // End of property values private boolean defaultColumn; @@ -76,7 +77,6 @@ .getNumeric().getValue(); numberColumnsSpanned = pList.get(PR_NUMBER_COLUMNS_SPANNED) .getNumeric().getValue(); - visibility = pList.get(PR_VISIBILITY).getEnum(); super.bind(pList); if (numberColumnsRepeated <= 0) { @@ -238,4 +238,4 @@ protected void releasePropertyList() { this.pList = null; } -} \ No newline at end of file +} Index: src/java/org/apache/fop/fo/flow/BidiOverride.java =================================================================== --- src/java/org/apache/fop/fo/flow/BidiOverride.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/BidiOverride.java (working copy) @@ -40,18 +40,19 @@ // used for FO validation private boolean blockOrInlineItemFound = false; private boolean canHaveBlockLevelChildren = true; - // The value of properties relevant for fo:bidi-override. - private CommonAural commonAural; - private CommonFont commonFont; - private CommonRelativePosition commonRelativePosition; - private Color prColor; // private ToBeImplementedProperty prDirection; // private ToBeImplementedProperty prLetterSpacing; private SpaceProperty lineHeight; // private ToBeImplementedProperty prScoreSpaces; // private ToBeImplementedProperty prUnicodeBidi; - private SpaceProperty prWordSpacing; + + // Unused but valid items, commented out for performance: + // private CommonAural commonAural; + // private CommonFont commonFont; + // private CommonRelativePosition commonRelativePosition; + // private Color prColor; + // private SpaceProperty prWordSpacing; // End of property values /** @@ -84,16 +85,11 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAural = pList.getAuralProps(); - commonFont = pList.getFontProps(); - commonRelativePosition = pList.getRelativePositionProps(); - prColor = pList.get(PR_COLOR).getColor(getUserAgent()); // prDirection = pList.get(PR_DIRECTION); // prLetterSpacing = pList.get(PR_LETTER_SPACING); lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); // prScoreSpaces = pList.get(PR_SCORE_SPACES); // prUnicodeBidi = pList.get(PR_UNICODE_BIDI); - prWordSpacing = pList.get(PR_WORD_SPACING).getSpace(); } /** Index: src/java/org/apache/fop/fo/flow/MultiProperties.java =================================================================== --- src/java/org/apache/fop/fo/flow/MultiProperties.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/MultiProperties.java (working copy) @@ -34,8 +34,9 @@ */ public class MultiProperties extends FObj { // The value of properties relevant for fo:multi-properties. - private CommonAccessibility commonAccessibility; private String id; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; // End of property values static boolean notImplementedWarningGiven = false; @@ -60,7 +61,6 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); id = pList.get(PR_ID).getString(); } Index: src/java/org/apache/fop/fo/flow/FootnoteBody.java =================================================================== --- src/java/org/apache/fop/fo/flow/FootnoteBody.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/FootnoteBody.java (working copy) @@ -33,8 +33,8 @@ * Class modelling the fo:footnote-body object. */ public class FootnoteBody extends FObj { - // The value of properties relevant for fo:footnote-body. - private CommonAccessibility commonAccessibility; + // The value of properties relevant for fo:footnote-body (commented out for perforance). + // private CommonAccessibility commonAccessibility; // End of property values /** @@ -48,7 +48,6 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); } /** Index: src/java/org/apache/fop/fo/flow/AbstractGraphics.java =================================================================== --- src/java/org/apache/fop/fo/flow/AbstractGraphics.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/AbstractGraphics.java (working copy) @@ -41,34 +41,37 @@ // The value of properties relevant for fo:instream-foreign-object // and external-graphics. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonMarginInline commonMarginInline; - private CommonRelativePosition commonRelativePosition; private Length alignmentAdjust; private int alignmentBaseline; private Length baselineShift; private LengthRangeProperty blockProgressionDimension; // private ToBeImplementedProperty clip; private Length contentHeight; - private String contentType; private Length contentWidth; private int displayAlign; private int dominantBaseline; private Length height; private String id; private LengthRangeProperty inlineProgressionDimension; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; private SpaceProperty lineHeight; private int overflow; private int scaling; - private int scalingMethod; private int textAlign; private Length width; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonMarginInline commonMarginInline; + // private CommonRelativePosition commonRelativePosition; + // private String contentType; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private int scalingMethod; // End of property values + + /** * constructs an instream-foreign-object object (called by Maker). * @@ -82,30 +85,22 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonMarginInline = pList.getMarginInlineProps(); - commonRelativePosition = pList.getRelativePositionProps(); alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength(); alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum(); baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); // clip = pList.get(PR_CLIP); contentHeight = pList.get(PR_CONTENT_HEIGHT).getLength(); - contentType = pList.get(PR_CONTENT_TYPE).getString(); contentWidth = pList.get(PR_CONTENT_WIDTH).getLength(); displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); height = pList.get(PR_HEIGHT).getLength(); id = pList.get(PR_ID).getString(); inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); overflow = pList.get(PR_OVERFLOW).getEnum(); scaling = pList.get(PR_SCALING).getEnum(); - scalingMethod = pList.get(PR_SCALING_METHOD).getEnum(); textAlign = pList.get(PR_TEXT_ALIGN).getEnum(); width = pList.get(PR_WIDTH).getLength(); } Index: src/java/org/apache/fop/fo/flow/PageNumber.java =================================================================== --- src/java/org/apache/fop/fo/flow/PageNumber.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/PageNumber.java (working copy) @@ -45,31 +45,32 @@ */ public class PageNumber extends FObj { // The value of properties relevant for fo:page-number. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonFont commonFont; - private CommonMarginInline commonMarginInline; - private CommonRelativePosition commonRelativePosition; private Length alignmentAdjust; private int alignmentBaseline; private Length baselineShift; private int dominantBaseline; private String id; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; // private ToBeImplementedProperty letterSpacing; private SpaceProperty lineHeight; - private int scoreSpaces; - private Length textAltitude; /** Holds the text decoration values. May be null */ private CommonTextDecoration textDecoration; - private Length textDepth; // private ToBeImplementedProperty textShadow; - private int textTransform; - private int visibility; - private SpaceProperty wordSpacing; - private int wrapOption; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonMarginInline commonMarginInline; + // private CommonRelativePosition commonRelativePosition; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private int scoreSpaces; + // private Length textAltitude; + // private Length textDepth; + // private int textTransform; + // private int visibility; + // private SpaceProperty wordSpacing; + // private int wrapOption; // End of property values // Properties which are not explicitely listed but are still applicable @@ -86,30 +87,17 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); commonFont = pList.getFontProps(); - commonMarginInline = pList.getMarginInlineProps(); - commonRelativePosition = pList.getRelativePositionProps(); alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength(); alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum(); baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); id = pList.get(PR_ID).getString(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); // letterSpacing = pList.get(PR_LETTER_SPACING); lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); - scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum(); - textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength(); textDecoration = pList.getTextDecorationProps(); - textDepth = pList.get(PR_TEXT_DEPTH).getLength(); // textShadow = pList.get(PR_TEXT_SHADOW); - textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); - visibility = pList.get(PR_VISIBILITY).getEnum(); - wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); - wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); // implicit properties color = pList.get(Constants.PR_COLOR).getColor(getUserAgent()); Index: src/java/org/apache/fop/fo/flow/MultiCase.java =================================================================== --- src/java/org/apache/fop/fo/flow/MultiCase.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/MultiCase.java (working copy) @@ -31,11 +31,12 @@ */ public class MultiCase extends FObj { // The value of properties relevant for fo:multi-case. - private CommonAccessibility commonAccessibility; private String id; private int startingState; // private ToBeImplementedProperty caseName; // private ToBeImplementedProperty caseTitle; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; // End of property values static boolean notImplementedWarningGiven = false; @@ -56,7 +57,6 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); id = pList.get(PR_ID).getString(); startingState = pList.get(PR_STARTING_STATE).getEnum(); // caseName = pList.get(PR_CASE_NAME); Index: src/java/org/apache/fop/fo/flow/Table.java =================================================================== --- src/java/org/apache/fop/fo/flow/Table.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/Table.java (working copy) @@ -47,11 +47,8 @@ public class Table extends TableFObj { /** properties */ - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonMarginBlock commonMarginBlock; - private CommonRelativePosition commonRelativePosition; private LengthRangeProperty blockProgressionDimension; private int borderCollapse; private LengthPairProperty borderSeparation; @@ -59,14 +56,18 @@ private int breakBefore; private String id; private LengthRangeProperty inlineProgressionDimension; - private int intrusionDisplace; private KeepProperty keepTogether; private KeepProperty keepWithNext; private KeepProperty keepWithPrevious; private int tableLayout; private int tableOmitFooterAtBreak; private int tableOmitHeaderAtBreak; - private int writingMode; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonRelativePosition commonRelativePosition; + // private int intrusionDisplace; + // private int writingMode; /** extension properties */ private Length widowContentLimit; @@ -109,11 +110,8 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); commonMarginBlock = pList.getMarginBlockProps(); - commonRelativePosition = pList.getRelativePositionProps(); blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); borderCollapse = pList.get(PR_BORDER_COLLAPSE).getEnum(); borderSeparation = pList.get(PR_BORDER_SEPARATION).getLengthPair(); @@ -121,14 +119,12 @@ breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); id = pList.get(PR_ID).getString(); inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); - intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE).getEnum(); keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); tableLayout = pList.get(PR_TABLE_LAYOUT).getEnum(); tableOmitFooterAtBreak = pList.get(PR_TABLE_OMIT_FOOTER_AT_BREAK).getEnum(); tableOmitHeaderAtBreak = pList.get(PR_TABLE_OMIT_HEADER_AT_BREAK).getEnum(); - writingMode = pList.get(PR_WRITING_MODE).getEnum(); super.bind(pList); //Bind extension properties Index: src/java/org/apache/fop/fo/flow/TableFObj.java =================================================================== --- src/java/org/apache/fop/fo/flow/TableFObj.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/TableFObj.java (working copy) @@ -147,7 +147,6 @@ if (getNameId() == FO_TABLE_ROW) { TableRow row = (TableRow) this; - TableBody body = (TableBody) parent; for (i = colSpan; --i >= 0;) { row.pendingSpans.add(null); Index: src/java/org/apache/fop/fo/flow/MultiToggle.java =================================================================== --- src/java/org/apache/fop/fo/flow/MultiToggle.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/MultiToggle.java (working copy) @@ -34,8 +34,8 @@ * Class modelling the fo:multi-toggle property. */ public class MultiToggle extends FObj { - // The value of properties relevant for fo:multi-toggle. - private CommonAccessibility commonAccessibility; + // The value of properties relevant for fo:multi-toggle (commented out for performance). + // private CommonAccessibility commonAccessibility; // public ToBeImplementedProperty prSwitchTo; // End of property values @@ -57,7 +57,6 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); // prSwitchTo = pList.get(PR_SWITCH_TO); } Index: src/java/org/apache/fop/fo/flow/Float.java =================================================================== --- src/java/org/apache/fop/fo/flow/Float.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/Float.java (working copy) @@ -32,9 +32,9 @@ * fo:float element. */ public class Float extends FObj { - // The value of properties relevant for fo:float. - private int float_; - private int clear; + // The value of properties relevant for fo:float (commented out for performance. + // private int float_; + // private int clear; // End of property values static boolean notImplementedWarningGiven = false; @@ -55,8 +55,7 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - float_ = pList.get(PR_FLOAT).getEnum(); - clear = pList.get(PR_CLEAR).getEnum(); + // No active properties -> Nothing to do. } /** Index: src/java/org/apache/fop/fo/flow/TableCaption.java =================================================================== --- src/java/org/apache/fop/fo/flow/TableCaption.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/TableCaption.java (working copy) @@ -43,16 +43,17 @@ public class TableCaption extends FObj { // The value of properties relevant for fo:table-caption. private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonRelativePosition commonRelativePosition; - private LengthRangeProperty blockProgressionDimension; - private Length height; private String id; - private LengthRangeProperty inlineProgressionDimension; - private int intrusionDisplace; - private KeepProperty keepTogether; - private Length width; + // Unused but valid items, commented out for performance: + // private CommonAural commonAural; + // private CommonRelativePosition commonRelativePosition; + // private LengthRangeProperty blockProgressionDimension; + // private Length height; + // private LengthRangeProperty inlineProgressionDimension; + // private int intrusionDisplace; + // private KeepProperty keepTogether; + // private Length width; // End of property values /** used for FO validation */ @@ -77,16 +78,8 @@ */ public void bind(PropertyList pList) throws FOPException { commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonRelativePosition = pList.getRelativePositionProps(); - blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); - height = pList.get(PR_HEIGHT).getLength(); id = pList.get(PR_ID).getString(); - inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); - intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE).getEnum(); - keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); - width = pList.get(PR_WIDTH).getLength(); } /** Index: src/java/org/apache/fop/fo/flow/TableBody.java =================================================================== --- src/java/org/apache/fop/fo/flow/TableBody.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/TableBody.java (working copy) @@ -46,11 +46,12 @@ */ public class TableBody extends TableFObj { // The value of properties relevant for fo:table-body. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonRelativePosition commonRelativePosition; - private int visibility; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonRelativePosition commonRelativePosition; + // private int visibility; // End of property values private PropertyList savedPropertyList; @@ -80,11 +81,7 @@ * @see FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonRelativePosition = pList.getRelativePositionProps(); - visibility = pList.get(PR_VISIBILITY).getEnum(); super.bind(pList); //Used by convertCellsToRows() savedPropertyList = pList; @@ -240,6 +237,7 @@ * @throws FOPException if there's a problem binding the TableRow's * properties. */ + // TODO: This is currently unused. Why is it here? private void convertCellsToRows() throws FOPException { //getLogger().debug("Converting cells to rows..."); List cells = new java.util.ArrayList(childNodes); Index: src/java/org/apache/fop/fo/flow/InitialPropertySet.java =================================================================== --- src/java/org/apache/fop/fo/flow/InitialPropertySet.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/InitialPropertySet.java (working copy) @@ -41,20 +41,21 @@ */ public class InitialPropertySet extends FObj { // The value of properties relevant for fo:initial-property-set. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; - private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonFont commonFont; - private CommonRelativePosition commonRelativePosition; - private Color color; private String id; // private ToBeImplementedProperty letterSpacing; private SpaceProperty lineHeight; - private int scoreSpaces; - private int textDecoration; // private ToBeImplementedProperty textShadow; - private int textTransform; - private SpaceProperty wordSpacing; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonBorderPaddingBackground commonBorderPaddingBackground; + // private CommonFont commonFont; + // private CommonRelativePosition commonRelativePosition; + // private Color color; + // private int scoreSpaces; + // private int textDecoration; + // private int textTransform; + // private SpaceProperty wordSpacing; // End of property values /** @@ -68,20 +69,10 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); - commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonFont = pList.getFontProps(); - commonRelativePosition = pList.getRelativePositionProps(); - color = pList.get(PR_COLOR).getColor(getUserAgent()); id = pList.get(PR_ID).getString(); // letterSpacing = pList.get(PR_LETTER_SPACING); lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); - scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum(); - textDecoration = pList.get(PR_TEXT_DECORATION).getEnum(); // textShadow = pList.get(PR_TEXT_SHADOW); - textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); - wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); } /** Index: src/java/org/apache/fop/fo/flow/MultiSwitch.java =================================================================== --- src/java/org/apache/fop/fo/flow/MultiSwitch.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/MultiSwitch.java (working copy) @@ -35,9 +35,10 @@ */ public class MultiSwitch extends FObj { // The value of properties relevant for fo:multi-switch. - private CommonAccessibility commonAccessibility; // private ToBeImplementedProperty autoRestore; private String id; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; // End of property values static boolean notImplementedWarningGiven = false; @@ -58,7 +59,6 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); // autoRestore = pList.get(PR_AUTO_RESTORE); id = pList.get(PR_ID).getString(); } Index: src/java/org/apache/fop/fo/flow/Inline.java =================================================================== --- src/java/org/apache/fop/fo/flow/Inline.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/Inline.java (working copy) @@ -38,22 +38,22 @@ public class Inline extends InlineLevel { // The value of properties relevant for fo:inline. // See also superclass InlineLevel - private CommonRelativePosition commonRelativePosition; private Length alignmentAdjust; private int alignmentBaseline; private Length baselineShift; - private LengthRangeProperty blockProgressionDimension; private int dominantBaseline; - private Length height; private String id; - private LengthRangeProperty inlineProgressionDimension; - private KeepProperty keepTogether; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; - private Length width; - private int wrapOption; + // Unused but valid items, commented out for performance: + // private CommonRelativePosition commonRelativePosition; + // private LengthRangeProperty blockProgressionDimension; + // private Length height; + // private LengthRangeProperty inlineProgressionDimension; + // private KeepProperty keepTogether; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private Length width; + // private int wrapOption; // End of property values - // used for FO validation private boolean blockOrInlineItemFound = false; private boolean canHaveBlockLevelChildren = true; @@ -70,20 +70,11 @@ */ public void bind(PropertyList pList) throws FOPException { super.bind(pList); - commonRelativePosition = pList.getRelativePositionProps(); alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength(); alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum(); baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); - blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); - height = pList.get(PR_HEIGHT).getLength(); id = pList.get(PR_ID).getString(); - inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); - keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); - width = pList.get(PR_WIDTH).getLength(); - wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); } /** Index: src/java/org/apache/fop/fo/flow/TableRow.java =================================================================== --- src/java/org/apache/fop/fo/flow/TableRow.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/TableRow.java (working copy) @@ -42,11 +42,8 @@ */ public class TableRow extends TableFObj { // The value of properties relevant for fo:table-row. - private CommonAccessibility commonAccessibility; private LengthRangeProperty blockProgressionDimension; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonRelativePosition commonRelativePosition; private int breakAfter; private int breakBefore; private Length height; @@ -54,7 +51,11 @@ private KeepProperty keepTogether; private KeepProperty keepWithNext; private KeepProperty keepWithPrevious; - private int visibility; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonRelativePosition commonRelativePosition; + // private int visibility; // End of property values private boolean setup = false; @@ -74,12 +75,9 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonRelativePosition = pList.getRelativePositionProps(); breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); id = pList.get(PR_ID).getString(); @@ -87,7 +85,6 @@ keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); - visibility = pList.get(PR_VISIBILITY).getEnum(); super.bind(pList); } Index: src/java/org/apache/fop/fo/flow/PageNumberCitation.java =================================================================== --- src/java/org/apache/fop/fo/flow/PageNumberCitation.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/PageNumberCitation.java (working copy) @@ -48,32 +48,33 @@ */ public class PageNumberCitation extends FObj { // The value of properties relevant for fo:page-number-citation. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonFont commonFont; - private CommonMarginInline commonMarginInline; - private CommonRelativePosition commonRelativePosition; private Length alignmentAdjust; private int alignmentBaseline; private Length baselineShift; private int dominantBaseline; private String id; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; // private ToBeImplementedProperty letterSpacing; private SpaceProperty lineHeight; private String refId; - private int scoreSpaces; - private Length textAltitude; /** Holds the text decoration values. May be null */ private CommonTextDecoration textDecoration; - private Length textDepth; // private ToBeImplementedProperty textShadow; - private int textTransform; - private int visibility; - private SpaceProperty wordSpacing; - private int wrapOption; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonMarginInline commonMarginInline; + // private CommonRelativePosition commonRelativePosition; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private int scoreSpaces; + // private Length textAltitude; + // private Length textDepth; + // private int textTransform; + // private int visibility; + // private SpaceProperty wordSpacing; + // private int wrapOption; // End of property values // Properties which are not explicitely listed but are still applicable @@ -90,31 +91,18 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); commonFont = pList.getFontProps(); - commonMarginInline = pList.getMarginInlineProps(); - commonRelativePosition = pList.getRelativePositionProps(); alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength(); alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum(); baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); id = pList.get(PR_ID).getString(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); // letterSpacing = pList.get(PR_LETTER_SPACING); lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); refId = pList.get(PR_REF_ID).getString(); - scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum(); - textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength(); textDecoration = pList.getTextDecorationProps(); - textDepth = pList.get(PR_TEXT_DEPTH).getLength(); // textShadow = pList.get(PR_TEXT_SHADOW); - textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); - visibility = pList.get(PR_VISIBILITY).getEnum(); - wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); - wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); // implicit properties color = pList.get(Constants.PR_COLOR).getColor(getUserAgent()); Index: src/java/org/apache/fop/fo/flow/InlineContainer.java =================================================================== --- src/java/org/apache/fop/fo/flow/InlineContainer.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/InlineContainer.java (working copy) @@ -41,27 +41,28 @@ public class InlineContainer extends FObj { // The value of properties relevant for fo:inline-container. - private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonMarginInline commonMarginInline; - private CommonRelativePosition commonRelativePosition; private Length alignmentAdjust; private int alignmentBaseline; private Length baselineShift; - private LengthRangeProperty blockProgressionDimension; // private ToBeImplementedProperty clip; - private int displayAlign; private int dominantBaseline; - private Length height; private String id; - private LengthRangeProperty inlineProgressionDimension; - private KeepProperty keepTogether; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; private SpaceProperty lineHeight; - private int overflow; - private Numeric referenceOrientation; - private Length width; - private int writingMode; + // Unused but valid items, commented out for performance: + // private CommonBorderPaddingBackground commonBorderPaddingBackground; + // private CommonMarginInline commonMarginInline; + // private CommonRelativePosition commonRelativePosition; + // private LengthRangeProperty blockProgressionDimension; + // private int displayAlign; + // private Length height; + // private LengthRangeProperty inlineProgressionDimension; + // private KeepProperty keepTogether; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private int overflow; + // private Numeric referenceOrientation; + // private Length width; + // private int writingMode; // End of property values /** used for FO validation */ @@ -78,27 +79,13 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonMarginInline = pList.getMarginInlineProps(); - commonRelativePosition = pList.getRelativePositionProps(); alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength(); alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum(); baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); - blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); // clip = pList.get(PR_CLIP); - displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); - height = pList.get(PR_HEIGHT).getLength(); id = pList.get(PR_ID).getString(); - inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); - keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); - overflow = pList.get(PR_OVERFLOW).getEnum(); - referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric(); - width = pList.get(PR_WIDTH).getLength(); - writingMode = pList.get(PR_WRITING_MODE).getEnum(); } /** Index: src/java/org/apache/fop/fo/flow/ListBlock.java =================================================================== --- src/java/org/apache/fop/fo/flow/ListBlock.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/ListBlock.java (working copy) @@ -39,20 +39,21 @@ */ public class ListBlock extends FObj { // The value of properties relevant for fo:list-block. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonMarginBlock commonMarginBlock; - private CommonRelativePosition commonRelativePosition; private int breakAfter; private int breakBefore; private String id; - private int intrusionDisplace; private KeepProperty keepTogether; private KeepProperty keepWithNext; private KeepProperty keepWithPrevious; - private Length provisionalDistanceBetweenStarts; - private Length provisionalLabelSeparation; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonRelativePosition commonRelativePosition; + // private int intrusionDisplace; + // private Length provisionalDistanceBetweenStarts; + // private Length provisionalLabelSeparation; // End of property values /** extension properties */ @@ -73,23 +74,14 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); commonMarginBlock = pList.getMarginBlockProps(); - commonRelativePosition = pList.getRelativePositionProps(); breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); id = pList.get(PR_ID).getString(); - intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE).getEnum(); keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); - provisionalDistanceBetweenStarts = pList.get( - PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getLength(); - provisionalLabelSeparation = pList.get( - PR_PROVISIONAL_LABEL_SEPARATION).getLength(); - //Bind extension properties widowContentLimit = pList.get(PR_X_WIDOW_CONTENT_LIMIT).getLength(); orphanContentLimit = pList.get(PR_X_ORPHAN_CONTENT_LIMIT).getLength(); Index: src/java/org/apache/fop/fo/flow/TableCell.java =================================================================== --- src/java/org/apache/fop/fo/flow/TableCell.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/TableCell.java (working copy) @@ -40,28 +40,29 @@ */ public class TableCell extends TableFObj { // The value of properties relevant for fo:table-cell. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonRelativePosition commonRelativePosition; private LengthRangeProperty blockProgressionDimension; private int columnNumber; private int displayAlign; - private int relativeAlign; private int emptyCells; private int endsRow; - private Length height; private String id; - private LengthRangeProperty inlineProgressionDimension; private int numberColumnsSpanned; private int numberRowsSpanned; private int startsRow; private Length width; - private KeepProperty keepTogether; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonRelativePosition commonRelativePosition; + // private int relativeAlign; + // private Length height; + // private LengthRangeProperty inlineProgressionDimension; + // private KeepProperty keepTogether; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; // End of property values - + /** used for FO validation */ private boolean blockItemFound = false; @@ -106,26 +107,17 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonRelativePosition = pList.getRelativePositionProps(); blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); - relativeAlign = pList.get(PR_RELATIVE_ALIGN).getEnum(); emptyCells = pList.get(PR_EMPTY_CELLS).getEnum(); endsRow = pList.get(PR_ENDS_ROW).getEnum(); - height = pList.get(PR_HEIGHT).getLength(); id = pList.get(PR_ID).getString(); - inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); columnNumber = pList.get(PR_COLUMN_NUMBER).getNumeric().getValue(); numberColumnsSpanned = pList.get(PR_NUMBER_COLUMNS_SPANNED).getNumeric().getValue(); numberRowsSpanned = pList.get(PR_NUMBER_ROWS_SPANNED).getNumeric().getValue(); startsRow = pList.get(PR_STARTS_ROW).getEnum(); width = pList.get(PR_WIDTH).getLength(); - keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); super.bind(pList); } Index: src/java/org/apache/fop/fo/flow/TableAndCaption.java =================================================================== --- src/java/org/apache/fop/fo/flow/TableAndCaption.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/TableAndCaption.java (working copy) @@ -40,20 +40,21 @@ */ public class TableAndCaption extends FObj { // The value of properties relevant for fo:table-and-caption. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; - private CommonBorderPaddingBackground commonBorderPaddingBackground; - private CommonMarginBlock commonMarginBlock; - private CommonRelativePosition commonRelativePosition; - private int breakAfter; - private int breakBefore; - private int captionSide; private String id; - private int intrusionDisplace; - private KeepProperty keepTogether; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; - private int textAlign; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonBorderPaddingBackground commonBorderPaddingBackground; + // private CommonMarginBlock commonMarginBlock; + // private CommonRelativePosition commonRelativePosition; + // private int breakAfter; + // private int breakBefore; + // private int captionSide; + // private int intrusionDisplace; + // private KeepProperty keepTogether; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private int textAlign; // End of property values static boolean notImplementedWarningGiven = false; @@ -78,20 +79,7 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); - commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); - commonMarginBlock = pList.getMarginBlockProps(); - commonRelativePosition = pList.getRelativePositionProps(); - breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); - breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); - captionSide = pList.get(PR_CAPTION_SIDE).getEnum(); id = pList.get(PR_ID).getString(); - intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE).getEnum(); - keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); - textAlign = pList.get(PR_TEXT_ALIGN).getEnum(); } /** Index: src/java/org/apache/fop/fo/flow/ListItem.java =================================================================== --- src/java/org/apache/fop/fo/flow/ListItem.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/ListItem.java (working copy) @@ -38,19 +38,20 @@ */ public class ListItem extends FObj { // The value of properties relevant for fo:list-item. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonMarginBlock commonMarginBlock; - private CommonRelativePosition commonRelativePosition; private int breakAfter; private int breakBefore; private String id; - private int intrusionDisplace; private KeepProperty keepTogether; private KeepProperty keepWithNext; private KeepProperty keepWithPrevious; - private int relativeAlign; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private CommonRelativePosition commonRelativePosition; + // private int intrusionDisplace; + // private int relativeAlign; // End of property values private ListItemLabel label = null; @@ -67,19 +68,14 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); commonMarginBlock = pList.getMarginBlockProps(); - commonRelativePosition = pList.getRelativePositionProps(); breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); id = pList.get(PR_ID).getString(); - intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE).getEnum(); keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); - relativeAlign = pList.get(PR_RELATIVE_ALIGN).getEnum(); } /** Index: src/java/org/apache/fop/fo/flow/Block.java =================================================================== --- src/java/org/apache/fop/fo/flow/Block.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/Block.java (working copy) @@ -52,8 +52,6 @@ private boolean initialPropertySetFound = false; // The value of properties relevant for fo:block. - private CommonAccessibility commonAccessibility; - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonFont commonFont; private CommonHyphenation commonHyphenation; @@ -62,8 +60,6 @@ private int breakAfter; private int breakBefore; private Color color; - private Length textDepth; - private Length textAltitude; private int hyphenationKeep; private Numeric hyphenationLadderCount; private String id; @@ -82,10 +78,15 @@ private int textAlign; private int textAlignLast; private Length textIndent; - private int visibility; private int whiteSpaceCollapse; private Numeric widows; private int wrapOption; + // Unused but valid items, commented out for performance: + // private CommonAccessibility commonAccessibility; + // private CommonAural commonAural; + // private Length textDepth; + // private Length textAltitude; + // private int visibility; // End of property values /** @@ -100,8 +101,6 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); commonFont = pList.getFontProps(); commonHyphenation = pList.getHyphenationProps(); @@ -111,8 +110,6 @@ breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); color = pList.get(PR_COLOR).getColor(getUserAgent()); - textDepth = pList.get(PR_TEXT_DEPTH).getLength(); - textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength(); hyphenationKeep = pList.get(PR_HYPHENATION_KEEP).getEnum(); hyphenationLadderCount = pList.get(PR_HYPHENATION_LADDER_COUNT).getNumeric(); id = pList.get(PR_ID).getString(); @@ -131,7 +128,6 @@ textAlign = pList.get(PR_TEXT_ALIGN).getEnum(); textAlignLast = pList.get(PR_TEXT_ALIGN_LAST).getEnum(); textIndent = pList.get(PR_TEXT_INDENT).getLength(); - visibility = pList.get(PR_VISIBILITY).getEnum(); whiteSpaceCollapse = pList.get(PR_WHITE_SPACE_COLLAPSE).getEnum(); widows = pList.get(PR_WIDOWS).getNumeric(); wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); @@ -348,20 +344,6 @@ } /** - * @return Returns the commonAccessibility. - */ - public CommonAccessibility getCommonAccessibility() { - return this.commonAccessibility; - } - - /** - * @return Returns the commonAural. - */ - public CommonAural getCommonAural() { - return this.commonAural; - } - - /** * @return Returns the commonRelativePosition. */ public CommonRelativePosition getCommonRelativePosition() { Index: src/java/org/apache/fop/fo/flow/Leader.java =================================================================== --- src/java/org/apache/fop/fo/flow/Leader.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/Leader.java (working copy) @@ -37,16 +37,11 @@ public class Leader extends InlineLevel { // The value of properties relevant for fo:leader. // See also superclass InlineLevel - private CommonRelativePosition commonRelativePosition; private Length alignmentAdjust; private int alignmentBaseline; private Length baselineShift; private int dominantBaseline; - private Length textDepth; - private Length textAltitude; private String id; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; private int leaderAlignment; private LengthRangeProperty leaderLength; private int leaderPattern; @@ -55,7 +50,13 @@ private Length ruleThickness; // private ToBeImplementedProperty letterSpacing; // private ToBeImplementedProperty textShadow; - private SpaceProperty wordSpacing; + // Unused but valid items, commented out for performance: + // private CommonRelativePosition commonRelativePosition; + // private Length textDepth; + // private Length textAltitude; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private SpaceProperty wordSpacing; // End of property values /** @@ -70,16 +71,11 @@ */ public void bind(PropertyList pList) throws FOPException { super.bind(pList); - commonRelativePosition = pList.getRelativePositionProps(); alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength(); alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum(); baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); - textDepth = pList.get(PR_TEXT_DEPTH).getLength(); - textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength(); id = pList.get(PR_ID).getString(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); leaderAlignment = pList.get(PR_LEADER_ALIGNMENT).getEnum(); leaderLength = pList.get(PR_LEADER_LENGTH).getLengthRange(); leaderPattern = pList.get(PR_LEADER_PATTERN).getEnum(); @@ -105,7 +101,6 @@ } // letterSpacing = pList.get(PR_LETTER_SPACING); // textShadow = pList.get(PR_TEXT_SHADOW); - wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); } /** Index: src/java/org/apache/fop/fo/flow/Character.java =================================================================== --- src/java/org/apache/fop/fo/flow/Character.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/Character.java (working copy) @@ -57,36 +57,37 @@ */ public class Character extends FObj { // The value of properties relevant for fo:character. - private CommonAural commonAural; private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonFont commonFont; private CommonHyphenation commonHyphenation; - private CommonMarginInline commonMarginInline; - private CommonRelativePosition commonRelativePosition; private Length alignmentAdjust; - private int treatAsWordSpace; private int alignmentBaseline; private Length baselineShift; private char character; private Color color; private int dominantBaseline; - private Length textDepth; - private Length textAltitude; // private ToBeImplementedProperty glyphOrientationHorizontal; // private ToBeImplementedProperty glyphOrientationVertical; private String id; - private KeepProperty keepWithNext; - private KeepProperty keepWithPrevious; private Property letterSpacing; private SpaceProperty lineHeight; - private int scoreSpaces; - private int suppressAtLineBreak; /** Holds the text decoration values. May be null */ private CommonTextDecoration textDecoration; // private ToBeImplementedProperty textShadow; - private int textTransform; - private int visibility; private Property wordSpacing; + // Unused but valid items, commented out for performance: + // private CommonAural commonAural; + // private CommonMarginInline commonMarginInline; + // private CommonRelativePosition commonRelativePosition; + // private int treatAsWordSpace; + // private Length textDepth; + // private Length textAltitude; + // private KeepProperty keepWithNext; + // private KeepProperty keepWithPrevious; + // private int scoreSpaces; + // private int suppressAtLineBreak; + // private int textTransform; + // private int visibility; // End of property values /** constant indicating that the character is OK */ @@ -105,35 +106,23 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAural = pList.getAuralProps(); commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); commonFont = pList.getFontProps(); commonHyphenation = pList.getHyphenationProps(); - commonMarginInline = pList.getMarginInlineProps(); - commonRelativePosition = pList.getRelativePositionProps(); alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength(); - treatAsWordSpace = pList.get(PR_TREAT_AS_WORD_SPACE).getEnum(); alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum(); baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); character = pList.get(PR_CHARACTER).getCharacter(); color = pList.get(PR_COLOR).getColor(getUserAgent()); dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); - textDepth = pList.get(PR_TEXT_DEPTH).getLength(); - textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength(); // glyphOrientationHorizontal = pList.get(PR_GLYPH_ORIENTATION_HORIZONTAL); // glyphOrientationVertical = pList.get(PR_GLYPH_ORIENTATION_VERTICAL); id = pList.get(PR_ID).getString(); - keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); - keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); letterSpacing = pList.get(PR_LETTER_SPACING); lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); - scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum(); - suppressAtLineBreak = pList.get(PR_SUPPRESS_AT_LINE_BREAK).getEnum(); textDecoration = pList.getTextDecorationProps(); // textShadow = pList.get(PR_TEXT_SHADOW); - textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); - visibility = pList.get(PR_VISIBILITY).getEnum(); wordSpacing = pList.get(PR_WORD_SPACING); } Index: src/java/org/apache/fop/fo/flow/BlockContainer.java =================================================================== --- src/java/org/apache/fop/fo/flow/BlockContainer.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/BlockContainer.java (working copy) @@ -50,7 +50,6 @@ private Length height; private String id; private LengthRangeProperty inlineProgressionDimension; - private int intrusionDisplace; private KeepProperty keepTogether; private KeepProperty keepWithNext; private KeepProperty keepWithPrevious; @@ -59,7 +58,9 @@ private int span; private Length width; private int writingMode; - private Numeric zIndex; + // Unused but valid items, commented out for performance: + // private int intrusionDisplace; + // private Numeric zIndex; // End of property values /** used for FO validation */ @@ -87,7 +88,6 @@ height = pList.get(PR_HEIGHT).getLength(); id = pList.get(PR_ID).getString(); inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); - intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE).getEnum(); keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); @@ -96,7 +96,6 @@ span = pList.get(PR_SPAN).getEnum(); width = pList.get(PR_WIDTH).getLength(); writingMode = pList.get(PR_WRITING_MODE).getEnum(); - zIndex = pList.get(PR_Z_INDEX).getNumeric(); } /** Index: src/java/org/apache/fop/fo/flow/Footnote.java =================================================================== --- src/java/org/apache/fop/fo/flow/Footnote.java (revision 488651) +++ src/java/org/apache/fop/fo/flow/Footnote.java (working copy) @@ -32,8 +32,8 @@ * Class modelling the fo:footnote object. */ public class Footnote extends FObj { - // The value of properties relevant for fo:footnote. - private CommonAccessibility commonAccessibility; + // The value of properties relevant for fo:footnote (commented out for performance). + // private CommonAccessibility commonAccessibility; // End of property values private Inline footnoteCitation = null; @@ -50,7 +50,7 @@ * @see org.apache.fop.fo.FObj#bind(PropertyList) */ public void bind(PropertyList pList) throws FOPException { - commonAccessibility = pList.getAccessibilityProps(); + // No active properties -> do nothing. } /** Index: src/java/org/apache/fop/fo/expr/PropertyParser.java =================================================================== --- src/java/org/apache/fop/fo/expr/PropertyParser.java (revision 488651) +++ src/java/org/apache/fop/fo/expr/PropertyParser.java (working copy) @@ -293,7 +293,7 @@ prop = (Property) NumericOp.multiply(new NumberProperty(numPart.doubleValue()), propInfo.currentFontSize()); } else { - prop = new FixedLength(numPart.doubleValue(), unitPart); + prop = FixedLength.getInstance(numPart.doubleValue(), unitPart); } break; Index: src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java =================================================================== --- src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java (revision 488651) +++ src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java (working copy) @@ -102,7 +102,6 @@ * @throws PropertyException when an exception occur during evaluation. */ private Numeric getResolved(PercentBaseContext context) throws PropertyException { - Numeric n; switch (operation) { case ADDITION: return NumericOp.addition2(op1, op2, context); Index: build.xml =================================================================== --- build.xml (revision 488651) +++ build.xml (working copy) @@ -150,7 +150,7 @@ - +