aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/expr
diff options
context:
space:
mode:
authorFinn Bock <bckfnn@apache.org>2004-10-20 13:19:25 +0000
committerFinn Bock <bckfnn@apache.org>2004-10-20 13:19:25 +0000
commit3f8fd79510740cd0ab03493f58b8fdc9009beda0 (patch)
treedc0949b9eb04a556b8440354cccd0db917ca1d1f /src/java/org/apache/fop/fo/expr
parentd6a9ce7871ce451533b59b8b83eea09de61c1318 (diff)
downloadxmlgraphics-fop-3f8fd79510740cd0ab03493f58b8fdc9009beda0.tar.gz
xmlgraphics-fop-3f8fd79510740cd0ab03493f58b8fdc9009beda0.zip
Fourth phase of performance improvement.
- Get rid of calls to FObj.getProperty() and its friends. Replace them with the property getters on the FO nodes. PR: 31699 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198086 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/expr')
-rw-r--r--src/java/org/apache/fop/fo/expr/BodyStartFunction.java13
-rw-r--r--src/java/org/apache/fop/fo/expr/LabelEndFunction.java14
2 files changed, 13 insertions, 14 deletions
diff --git a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
index f58b17718..d064ee998 100644
--- a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
+++ b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
@@ -20,7 +20,7 @@ package org.apache.fop.fo.expr;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.flow.ListItem;
import org.apache.fop.fo.properties.Property;
@@ -49,16 +49,15 @@ public class BodyStartFunction extends FunctionBase {
Numeric distance =
pInfo.getPropertyList().get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getNumeric();
- FONode item = pInfo.getFO();
- while (item != null && !(item instanceof ListItem)) {
- item = item.getParent();
+ PropertyList pList = pInfo.getPropertyList();
+ while (pList != null && !(pList.getFObj() instanceof ListItem)) {
+ pList = pList.getParentPropertyList();
}
- if (item == null) {
+ if (pList == null) {
throw new PropertyException("body-start() called from outside an fo:list-item");
}
- Numeric startIndent =
- ((ListItem)item).getProperty(Constants.PR_START_INDENT).getNumeric();
+ Numeric startIndent = pList.get(Constants.PR_START_INDENT).getNumeric();
return (Property) NumericOp.addition(distance, startIndent);
}
diff --git a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
index 5e88418e2..5b74fb41b 100644
--- a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
+++ b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
@@ -22,7 +22,7 @@ import org.apache.fop.datatypes.Numeric;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.LengthBase;
import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.flow.ListItem;
import org.apache.fop.fo.properties.PercentLength;
import org.apache.fop.fo.properties.Property;
@@ -56,17 +56,17 @@ public class LabelEndFunction extends FunctionBase {
Length separation =
pInfo.getPropertyList().getNearestSpecified(Constants.PR_PROVISIONAL_LABEL_SEPARATION).getLength();
- FONode item = pInfo.getFO();
- while (item != null && !(item instanceof ListItem)) {
- item = item.getParent();
+ PropertyList pList = pInfo.getPropertyList();
+ while (pList != null && !(pList.getFObj() instanceof ListItem)) {
+ pList = pList.getParentPropertyList();
}
- if (item == null) {
+ if (pList == null) {
throw new PropertyException("label-end() called from outside an fo:list-item");
}
- Length startIndent = ((ListItem)item).getProperty(Constants.PR_START_INDENT).getLength();
+ Length startIndent = pList.get(Constants.PR_START_INDENT).getLength();
// Should be CONTAINING_REFAREA but that doesn't work
- LengthBase base = new LengthBase((ListItem)item, pInfo.getPropertyList(),
+ LengthBase base = new LengthBase(pList.getFObj(), pInfo.getPropertyList(),
LengthBase.CONTAINING_BOX);
PercentLength refWidth = new PercentLength(1.0, base);