From cfa9f0b37c8c3c57f6cdd7bce35495363de1db4b Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Thu, 27 May 2004 15:12:04 +0000 Subject: [PATCH] Added NULL_DECORATION for use as initial value, to indicate that no decoration has been defined on a node. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197637 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/fo/properties/TextDecoration.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/java/org/apache/fop/fo/properties/TextDecoration.java b/src/java/org/apache/fop/fo/properties/TextDecoration.java index 24c637e23..7ccb84f08 100644 --- a/src/java/org/apache/fop/fo/properties/TextDecoration.java +++ b/src/java/org/apache/fop/fo/properties/TextDecoration.java @@ -28,14 +28,13 @@ import org.apache.fop.datatypes.NCName; import org.apache.fop.datatypes.None; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.PropertyValueList; -import org.apache.fop.datatypes.TextDecorations; import org.apache.fop.datatypes.TextDecorator; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropNames; import org.apache.fop.fo.expr.PropertyException; public class TextDecoration extends Property { - public static final int dataTypes = COMPLEX | NONE | INHERIT; + public static final int dataTypes = COMPLEX | NONE; public int getDataTypes() { return dataTypes; @@ -53,11 +52,17 @@ public class TextDecoration extends Property { return initialValueType; } + /** + * text-decoration cannot be inherited, even though the current value + * is passed down to all text-bearing chikdren of a block on which it is + * defined. Just return a NoProperty. + * + */ public PropertyValue getInitialValue(int property) throws PropertyException { - return new TextDecorations - (PropNames.TEXT_DECORATION, NO_DECORATION); + return new TextDecorator( + PropNames.TEXT_DECORATION, NULL_DECORATION, NULL_DECORATION); } public static final int inherited = NO; @@ -68,13 +73,14 @@ public class TextDecoration extends Property { /** Text decoration constant. */ public static final byte - NO_DECORATION = 0 - ,UNDERLINE = 1 - ,OVERLINE = 2 - ,LINE_THROUGH = 4 - ,BLINK = 8 - - ,ALL_DECORATIONS = UNDERLINE | OVERLINE | LINE_THROUGH | BLINK + NULL_DECORATION = -1 + ,NO_DECORATION = 0 + ,UNDERLINE = 1 + ,OVERLINE = 2 + ,LINE_THROUGH = 4 + ,BLINK = 8 + + ,ALL_DECORATIONS = UNDERLINE | OVERLINE | LINE_THROUGH | BLINK ; -- 2.39.5