From 11b33608e1cfd3526460c11dff74c0493c0425fd Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 18 Mar 2005 08:11:48 +0000 Subject: [PATCH] Convenience method for checking "auto" enum value on a property. Makes code more readable. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198506 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/properties/Property.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/java/org/apache/fop/fo/properties/Property.java b/src/java/org/apache/fop/fo/properties/Property.java index 555b9ea3c..3d4dbe65d 100644 --- a/src/java/org/apache/fop/fo/properties/Property.java +++ b/src/java/org/apache/fop/fo/properties/Property.java @@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.Numeric; +import org.apache.fop.fo.Constants; /** * Base class for all property objects @@ -126,6 +127,11 @@ public class Property { return 0; } + /** @return true if the property is an enum and has value 'auto' */ + public boolean isAuto() { + return (getEnum() == Constants.EN_AUTO); + } + /** * This method expects to be overridden by subclasses * @return char property value -- 2.39.5