summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFinn Bock <bckfnn@apache.org>2004-10-28 15:21:54 +0000
committerFinn Bock <bckfnn@apache.org>2004-10-28 15:21:54 +0000
commitc79639a5e7e393fb36de72c9271217158858d848 (patch)
tree3b70677ecbcc8956d3007fa3e10c081f1a88da37
parentb0e76bca6ec366023f5f98d8e07aa77dbfabafe1 (diff)
downloadxmlgraphics-fop-c79639a5e7e393fb36de72c9271217158858d848.tar.gz
xmlgraphics-fop-c79639a5e7e393fb36de72c9271217158858d848.zip
Removed special case handling of "auto" enum for length properties.
Added general support for "auto" and other enums on Length and Numeric properties. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198107 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/datatypes/Length.java6
-rw-r--r--src/java/org/apache/fop/datatypes/Numeric.java5
-rw-r--r--src/java/org/apache/fop/fo/FOPropertyMapping.java34
-rw-r--r--src/java/org/apache/fop/fo/expr/NumericProperty.java7
-rwxr-xr-xsrc/java/org/apache/fop/fo/expr/RelativeNumericProperty.java7
-rw-r--r--src/java/org/apache/fop/fo/pagination/PageSequence.java8
-rw-r--r--src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java6
-rwxr-xr-xsrc/java/org/apache/fop/fo/properties/EnumLength.java74
-rwxr-xr-x[-rw-r--r--]src/java/org/apache/fop/fo/properties/EnumNumber.java (renamed from src/java/org/apache/fop/fo/properties/AutoLength.java)40
-rw-r--r--src/java/org/apache/fop/fo/properties/LengthProperty.java39
-rw-r--r--src/java/org/apache/fop/fo/properties/NumberProperty.java3
-rw-r--r--src/java/org/apache/fop/fo/properties/PropertyMaker.java6
-rw-r--r--src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java10
-rw-r--r--src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java12
-rw-r--r--src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java12
-rw-r--r--src/java/org/apache/fop/render/rtf/TableAttributesConverter.java2
-rw-r--r--src/java/org/apache/fop/render/rtf/TextAttributesConverter.java4
17 files changed, 153 insertions, 122 deletions
diff --git a/src/java/org/apache/fop/datatypes/Length.java b/src/java/org/apache/fop/datatypes/Length.java
index f2d32b99f..d64b2172d 100644
--- a/src/java/org/apache/fop/datatypes/Length.java
+++ b/src/java/org/apache/fop/datatypes/Length.java
@@ -27,10 +27,4 @@ public interface Length extends Numeric {
* @return the length in millipoints
*/
public int getValue();
-
- /**
- * Return true if the length has the "auto" value.
- * @return true when length is auto.
- */
- public boolean isAuto();
}
diff --git a/src/java/org/apache/fop/datatypes/Numeric.java b/src/java/org/apache/fop/datatypes/Numeric.java
index 22c0fc141..85a41e862 100644
--- a/src/java/org/apache/fop/datatypes/Numeric.java
+++ b/src/java/org/apache/fop/datatypes/Numeric.java
@@ -70,4 +70,9 @@ public interface Numeric {
* @throws PropertyException
*/
//Numeric getResolved() throws PropertyException;
+
+ /**
+ * Return the enum value that is stored in this numeric.
+ */
+ public int getEnum();
}
diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java
index 669a3793b..eefb9d23a 100644
--- a/src/java/org/apache/fop/fo/FOPropertyMapping.java
+++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java
@@ -517,28 +517,28 @@ public class FOPropertyMapping implements Constants {
// top
l = new LengthProperty.Maker(PR_TOP);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
addPropertyMaker("top", l);
// right
l = new LengthProperty.Maker(PR_RIGHT);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
addPropertyMaker("right", l);
// bottom
l = new LengthProperty.Maker(PR_BOTTOM);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
addPropertyMaker("bottom", l);
// left
l = new LengthProperty.Maker(PR_LEFT);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
addPropertyMaker("left", l);
}
@@ -1326,20 +1326,20 @@ public class FOPropertyMapping implements Constants {
l = new LengthProperty.Maker(CP_MINIMUM);
l.setDefault("auto");
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setPercentBase(LengthBase.CONTAINING_BOX);
l.setByShorthand(true);
m.addSubpropMaker(l);
l = new LengthProperty.Maker(CP_OPTIMUM);
l.setDefault("auto");
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setPercentBase(LengthBase.CONTAINING_BOX);
l.setByShorthand(true);
m.addSubpropMaker(l);
l = new LengthProperty.Maker(CP_MAXIMUM);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
l.setPercentBase(LengthBase.CONTAINING_BOX);
l.setByShorthand(true);
@@ -1358,21 +1358,21 @@ public class FOPropertyMapping implements Constants {
// content-height
l = new LengthProperty.Maker(PR_CONTENT_HEIGHT);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
addPropertyMaker("content-height", l);
// content-width
l = new LengthProperty.Maker(PR_CONTENT_WIDTH);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
addPropertyMaker("content-width", l);
// height
l = new LengthProperty.Maker(PR_HEIGHT);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
addPropertyMaker("height", l);
@@ -1383,20 +1383,20 @@ public class FOPropertyMapping implements Constants {
l = new LengthProperty.Maker(CP_MINIMUM);
l.setDefault("auto");
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setPercentBase(LengthBase.CONTAINING_BOX);
l.setByShorthand(true);
m.addSubpropMaker(l);
l = new LengthProperty.Maker(CP_OPTIMUM);
l.setDefault("auto");
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setPercentBase(LengthBase.CONTAINING_BOX);
l.setByShorthand(true);
m.addSubpropMaker(l);
l = new LengthProperty.Maker(CP_MAXIMUM);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("auto");
l.setPercentBase(LengthBase.CONTAINING_BOX);
l.setByShorthand(true);
@@ -1453,7 +1453,7 @@ public class FOPropertyMapping implements Constants {
// width
l = new LengthProperty.Maker(PR_WIDTH);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setPercentBase(LengthBase.BLOCK_WIDTH);
l.setDefault("auto");
addPropertyMaker("width", l);
@@ -2036,7 +2036,7 @@ public class FOPropertyMapping implements Constants {
// column-gap
l = new LengthProperty.Maker(PR_COLUMN_GAP);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("0.25in");
addPropertyMaker("column-gap", l);
@@ -2110,7 +2110,7 @@ public class FOPropertyMapping implements Constants {
// page-height
l = new LengthProperty.Maker(PR_PAGE_HEIGHT);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("11in");
addPropertyMaker("page-height", l);
@@ -2127,7 +2127,7 @@ public class FOPropertyMapping implements Constants {
// page-width
l = new LengthProperty.Maker(PR_PAGE_WIDTH);
l.setInherited(false);
- l.setAutoOk(true);
+ l.addEnum("auto", makeEnumProperty(AUTO, "AUTO"));
l.setDefault("8in");
addPropertyMaker("page-width", l);
diff --git a/src/java/org/apache/fop/fo/expr/NumericProperty.java b/src/java/org/apache/fop/fo/expr/NumericProperty.java
index 6f337e0f5..ddaac5088 100644
--- a/src/java/org/apache/fop/fo/expr/NumericProperty.java
+++ b/src/java/org/apache/fop/fo/expr/NumericProperty.java
@@ -90,13 +90,6 @@ public class NumericProperty extends Property implements Numeric, Length {
}
/**
- * Return false since a numeric can not have the enum value of 'auto'.
- */
- public boolean isAuto() {
- return false;
- }
-
- /**
* Cast this as a length. That is only possible when the dimension is
* one.
*/
diff --git a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
index c20017f85..97e940d0b 100755
--- a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
+++ b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
@@ -175,13 +175,6 @@ public class RelativeNumericProperty extends Property implements Numeric, Length
}
/**
- * Return false, since a numeric is never the "auto" enum.
- */
- public boolean isAuto() {
- return false;
- }
-
- /**
* Return a string represention of the expression. Only used for debugging.
*/
public String toString() {
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java
index 6cf181373..65ac9b768 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java
@@ -24,11 +24,11 @@ import java.util.HashMap;
import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
-import org.apache.fop.fo.properties.Property;
/**
* This provides pagination of flows onto pages. Much of the
@@ -44,7 +44,7 @@ public class PageSequence extends FObj {
private char groupingSeparator;
private int groupingSize;
private String id;
- private Property initialPageNumber;
+ private Numeric initialPageNumber;
private int forcePageCount;
private String masterReference;
// End of property values
@@ -142,7 +142,7 @@ public class PageSequence extends FObj {
groupingSeparator = pList.get(PR_GROUPING_SEPARATOR).getCharacter();
groupingSize = pList.get(PR_GROUPING_SIZE).getNumber().intValue();
id = pList.get(PR_ID).getString();
- initialPageNumber = pList.get(PR_INITIAL_PAGE_NUMBER);
+ initialPageNumber = pList.get(PR_INITIAL_PAGE_NUMBER).getNumeric();
forcePageCount = pList.get(PR_FORCE_PAGE_COUNT).getEnum();
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
}
@@ -163,7 +163,7 @@ public class PageSequence extends FObj {
pageNumberType = initialPageNumber.getEnum();
} else {
pageNumberType = EXPLICIT;
- int pageStart = initialPageNumber.getNumber().intValue();
+ int pageStart = initialPageNumber.getValue();
this.explicitFirstNumber = (pageStart > 0) ? pageStart : 1;
}
diff --git a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
index ab09b266d..1f8e57779 100644
--- a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
@@ -168,10 +168,8 @@ public class CompoundPropertyMaker extends PropertyMaker {
protected Property convertProperty(Property p,
PropertyList propertyList,
FObj fo) throws PropertyException {
- if (!EnumProperty.class.isAssignableFrom(p.getClass())) {
- // delegate to the subprop maker to do conversions
- p = shorthandMaker.convertProperty(p, propertyList, fo);
- }
+ // delegate to the subprop maker to do conversions
+ p = shorthandMaker.convertProperty(p, propertyList, fo);
if (p != null) {
Property prop = makeCompound(propertyList, fo);
diff --git a/src/java/org/apache/fop/fo/properties/EnumLength.java b/src/java/org/apache/fop/fo/properties/EnumLength.java
new file mode 100755
index 000000000..a968a0acf
--- /dev/null
+++ b/src/java/org/apache/fop/fo/properties/EnumLength.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fo.properties;
+
+/**
+ * A length quantity in XSL which is specified as an enum, such as "auto"
+ */
+public class EnumLength extends LengthProperty {
+ private Property enum;
+
+ public EnumLength(Property enum) {
+ this.enum = enum;
+ }
+
+ /**
+ * @see org.apache.fop.datatypes.Numeric#getEnum()
+ */
+ public int getEnum() {
+ return enum.getEnum();
+ }
+
+ public boolean isAbsolute() {
+ return false;
+ }
+ /**
+ * Returns the length in 1/1000ths of a point (millipoints)
+ * @return the length in millipoints
+ */
+ public int getValue() {
+ log.error("getValue() called on " + enum + " length");
+ return 0;
+ }
+
+ /**
+ * Returns the value as numeric.
+ * @return the length in millipoints
+ */
+ public double getNumericValue() {
+ log.error("getNumericValue() called on " + enum + " number");
+ return 0;
+ }
+
+ /**
+ * @see org.apache.fop.fo.properties.Property#getString()
+ */
+ public String getString() {
+ return enum.toString();
+ }
+
+ /**
+ * @see org.apache.fop.fo.properties.Property#getString()
+ */
+ public Object getObject() {
+ return enum.getObject();
+ }
+
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/AutoLength.java b/src/java/org/apache/fop/fo/properties/EnumNumber.java
index 7f7a37a4b..967d0357f 100644..100755
--- a/src/java/org/apache/fop/fo/properties/AutoLength.java
+++ b/src/java/org/apache/fop/fo/properties/EnumNumber.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,32 +18,27 @@
package org.apache.fop.fo.properties;
-
/**
- * A length quantity in XSL which is specified as "auto".
+ * A number quantity in XSL which is specified as an enum, such as "no-limit".
*/
-public class AutoLength extends LengthProperty {
-
- /**
- * @see org.apache.fop.datatypes.Length#isAuto()
- */
- public boolean isAuto() {
- return true;
+public class EnumNumber extends NumberProperty {
+ private Property enum;
+
+ public EnumNumber(Property enum) {
+ super(null);
+ this.enum = enum;
}
- // Should we do something intelligent here to set the actual size?
- // Would need a reference object!
- // protected void computeValue() {
- // }
-
- public boolean isAbsolute() {
- return false;
+ public int getEnum() {
+ return enum.getEnum();
}
+
/**
* Returns the length in 1/1000ths of a point (millipoints)
* @return the length in millipoints
*/
public int getValue() {
+ log.error("getValue() called on " + enum + " number");
return 0;
}
@@ -52,6 +47,7 @@ public class AutoLength extends LengthProperty {
* @return the length in millipoints
*/
public double getNumericValue() {
+ log.error("getNumericValue() called on " + enum + " number");
return 0;
}
@@ -59,7 +55,15 @@ public class AutoLength extends LengthProperty {
* @see org.apache.fop.fo.properties.Property#getString()
*/
public String getString() {
- return "auto";
+ return enum.toString();
}
+ /**
+ * @see org.apache.fop.fo.properties.Property#getString()
+ */
+ public Object getObject() {
+ return enum.getObject();
+ }
+
+
}
diff --git a/src/java/org/apache/fop/fo/properties/LengthProperty.java b/src/java/org/apache/fop/fo/properties/LengthProperty.java
index 145b5c38e..78646d87c 100644
--- a/src/java/org/apache/fop/fo/properties/LengthProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthProperty.java
@@ -44,30 +44,6 @@ abstract public class LengthProperty extends Property
}
/**
- * protected Property checkPropertyKeywords(String value) {
- * if (isAutoLengthAllowed() && value.equals("auto")) {
- * return new LengthProperty(Length.AUTO);
- * }
- * return null;
- * }
- */
-
- /**
- * @return false (auto-length is not allowed for Length values)
- */
- protected boolean isAutoLengthAllowed() {
- return autoOk;
- }
-
- /**
- * Set the auto length flag.
- * @param inherited
- */
- public void setAutoOk(boolean autoOk) {
- this.autoOk = autoOk;
- }
-
- /**
* @see PropertyMaker#convertProperty
*/
public Property convertProperty(Property p,
@@ -77,11 +53,8 @@ abstract public class LengthProperty extends Property
if (prop != null) {
return prop;
}
- if (isAutoLengthAllowed()) {
- String pval = p.getString();
- if (pval != null && pval.equals("auto")) {
- return new AutoLength();
- }
+ if (p instanceof EnumProperty) {
+ return new EnumLength(p);
}
if (p instanceof LengthProperty) {
return p;
@@ -96,14 +69,6 @@ abstract public class LengthProperty extends Property
}
/**
- * Indicates if the length has the "auto" value.
- * @return True if the length is set to "auto"
- */
- public boolean isAuto() {
- return false;
- }
-
- /**
* Return the number of table units which are included in this
* length specification.
* This will always be 0 unless the property specification used
diff --git a/src/java/org/apache/fop/fo/properties/NumberProperty.java b/src/java/org/apache/fop/fo/properties/NumberProperty.java
index 7ae4be255..ba943d1f0 100644
--- a/src/java/org/apache/fop/fo/properties/NumberProperty.java
+++ b/src/java/org/apache/fop/fo/properties/NumberProperty.java
@@ -48,6 +48,9 @@ public class NumberProperty extends Property implements Numeric {
if (p instanceof NumberProperty) {
return p;
}
+ if (p instanceof EnumProperty) {
+ return new EnumNumber(p);
+ }
Number val = p.getNumber();
if (val != null) {
return new NumberProperty(val);
diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
index eed2a45df..7d5b8b86b 100644
--- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
@@ -406,10 +406,12 @@ public class PropertyMaker implements Cloneable {
// Check for keyword shorthand values to be substituted.
pvalue = checkValueKeywords(value);
// Override parsePropertyValue in each subclass of Property.Maker
- Property p = PropertyParser.parse(pvalue,
+ newProp = PropertyParser.parse(pvalue,
new PropertyInfo(this,
propertyList, fo));
- newProp = convertProperty(p, propertyList, fo);
+ }
+ if (newProp != null) {
+ newProp = convertProperty(newProp, propertyList, fo);
}
if (newProp == null) {
throw new org.apache.fop.fo.expr.PropertyException("No conversion defined " + pvalue);
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
index 6e360bbe2..315004305 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
@@ -91,10 +91,10 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
int ipd = context.getRefIPD();
int bpd = context.getStackLimit().opt;
- if (!width.isAuto()) {
+ if (width.getEnum() != AUTO) {
ipd = width.getValue();
}
- if (!height.isAuto()) {
+ if (height.getEnum() != AUTO) {
bpd = height.getValue();
}
Rectangle2D rect = new Rectangle2D.Double(0, 0, ipd, bpd);
@@ -111,7 +111,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
relDims.ipd = context.getRefIPD();
}
stackLimit = new MinOptMax(relDims.ipd);
- if (width.isAuto()) {
+ if (width.getEnum() == AUTO) {
relDims.bpd = context.getStackLimit().opt;
}
absoluteCTM = new CTM(vals[0], vals[1], vals[2], vals[3], 0, 0);
@@ -301,7 +301,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
// need to set bpd to actual size for rotation
// and stacking
viewportBlockArea.setIPD(relDims.ipd);
- if (!height.isAuto()) {
+ if (height.getEnum() != AUTO) {
viewportBlockArea.setBPD(relDims.bpd);
autoHeight = false;
}
@@ -309,7 +309,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager {
viewportBlockArea.setClip(clip);
} else {
viewportBlockArea.setIPD(relDims.ipd);
- if (!height.isAuto()) {
+ if (height.getEnum() != AUTO) {
viewportBlockArea.setBPD(relDims.bpd);
autoHeight = false;
}
diff --git a/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java
index 41a1e62eb..0b0c9073d 100644
--- a/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java
@@ -74,20 +74,20 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager {
// assume lr-tb for now and just use the .optimum value of the range
Length ipd = fobj.getInlineProgressionDimension().getOptimum().getLength();
- if (!ipd.isAuto()) {
+ if (ipd.getEnum() != AUTO) {
viewWidth = ipd.getValue();
} else {
ipd = fobj.getWidth();
- if (!ipd.isAuto()) {
+ if (ipd.getEnum() != AUTO) {
viewWidth = ipd.getValue();
}
}
Length bpd = fobj.getBlockProgressionDimension().getOptimum().getLength();
- if (!bpd.isAuto()) {
+ if (bpd.getEnum() != AUTO) {
viewHeight = bpd.getValue();
} else {
bpd = fobj.getHeight();
- if (!bpd.isAuto()) {
+ if (bpd.getEnum() != AUTO) {
viewHeight = bpd.getValue();
}
}
@@ -98,7 +98,7 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager {
int cwidth = -1;
int cheight = -1;
Length ch = fobj.getContentHeight();
- if (!ch.isAuto()) {
+ if (ch.getEnum() != AUTO) {
/*if (ch.scaleToFit()) {
if (viewHeight != -1) {
cheight = viewHeight;
@@ -107,7 +107,7 @@ public class ExternalGraphicLayoutManager extends LeafNodeLayoutManager {
cheight = ch.getValue();
}
Length cw = fobj.getContentWidth();
- if (!cw.isAuto()) {
+ if (cw.getEnum() != AUTO) {
/*if (cw.scaleToFit()) {
if (viewWidth != -1) {
cwidth = viewWidth;
diff --git a/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java b/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java
index 2cdfbb2df..0efe6eaaa 100644
--- a/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java
+++ b/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java
@@ -77,22 +77,22 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager {
// isn't the block-progression-dimension always in the same
// direction as the line height?
len = fobj.getBlockProgressionDimension().getOptimum().getLength();
- if (!len.isAuto()) {
+ if (len.getEnum() != AUTO) {
bpd = len.getValue();
} else {
len = fobj.getHeight();
- if (!len.isAuto()) {
+ if (len.getEnum() != AUTO) {
bpd = len.getValue();
}
}
}
len = fobj.getInlineProgressionDimension().getOptimum().getLength();
- if (!len.isAuto()) {
+ if (len.getEnum() != AUTO) {
ipd = len.getValue();
} else {
len = fobj.getWidth();
- if (!len.isAuto()) {
+ if (len.getEnum() != AUTO) {
ipd = len.getValue();
}
}
@@ -102,7 +102,7 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager {
int cwidth = -1;
int cheight = -1;
len = fobj.getContentWidth();
- if (!len.isAuto()) {
+ if (len.getEnum() != AUTO) {
/*if(len.scaleToFit()) {
if(ipd != -1) {
cwidth = ipd;
@@ -111,7 +111,7 @@ public class InstreamForeignObjectLM extends LeafNodeLayoutManager {
cwidth = len.getValue();
}
len = fobj.getContentHeight();
- if (!len.isAuto()) {
+ if (len.getEnum() != AUTO) {
/*if(len.scaleToFit()) {
if(bpd != -1) {
cwidth = bpd;
diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
index d37db2ca5..8310f86bc 100644
--- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
@@ -191,7 +191,7 @@ public class TableAttributesConverter {
}
//Check for height row attribute.
- if (!fobj.getHeight().isAuto()) {
+ if (fobj.getHeight().getEnum() != Constants.AUTO) {
attrib.set(ITableAttributes.ROW_HEIGHT, fobj.getHeight().getValue() / (1000 / 20));
}
diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
index 6efa54ad7..a6aed80a0 100644
--- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
@@ -186,11 +186,11 @@ class TextAttributesConverter {
/*
private static void attrBlockDimension(FObj fobj, FOPRtfAttributes rtfAttr) {
Length ipd = fobj.getProperty(Constants.PR_INLINE_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength();
- if (!ipd.isAuto()) {
+ if (ipd.getEnum() != Constants.AUTO) {
rtfAttr.set(RtfText.FRAME_WIDTH, ipd);
}
Length bpd = fobj.getProperty(Constants.PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange().getOptimum().getLength();
- if (!bpd.isAuto()) {
+ if (bpd.getEnum() != Constants.AUTO) {
rtfAttr.set(RtfText.FRAME_HEIGHT, bpd);
}
}