aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-01-28 11:04:38 +0000
committerJeremias Maerki <jeremias@apache.org>2005-01-28 11:04:38 +0000
commit5041422b2948bdccf9deedba4db61b030289ab2c (patch)
tree9916a6d0a1c1133f0fd303e4f83c1d6ae5906e3c /src/java/org/apache
parentdaddb74bf290e8d9e54f394542329662cc60af5e (diff)
downloadxmlgraphics-fop-5041422b2948bdccf9deedba4db61b030289ab2c.tar.gz
xmlgraphics-fop-5041422b2948bdccf9deedba4db61b030289ab2c.zip
CONTAINING_REFAREA seems to work now, so use it.
Rearranged calculation. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198332 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r--src/java/org/apache/fop/fo/expr/LabelEndFunction.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
index 5b74fb41b..d014662b3 100644
--- a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
+++ b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 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.
@@ -51,10 +51,10 @@ public class LabelEndFunction extends FunctionBase {
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
- Length distance =
- pInfo.getPropertyList().get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getLength();
- Length separation =
- pInfo.getPropertyList().getNearestSpecified(Constants.PR_PROVISIONAL_LABEL_SEPARATION).getLength();
+ Length distance = pInfo.getPropertyList().get(
+ Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getLength();
+ Length separation = pInfo.getPropertyList().getNearestSpecified(
+ Constants.PR_PROVISIONAL_LABEL_SEPARATION).getLength();
PropertyList pList = pInfo.getPropertyList();
while (pList != null && !(pList.getFObj() instanceof ListItem)) {
@@ -65,16 +65,17 @@ public class LabelEndFunction extends FunctionBase {
}
Length startIndent = pList.get(Constants.PR_START_INDENT).getLength();
- // Should be CONTAINING_REFAREA but that doesn't work
LengthBase base = new LengthBase(pList.getFObj(), pInfo.getPropertyList(),
- LengthBase.CONTAINING_BOX);
+ LengthBase.CONTAINING_REFAREA);
PercentLength refWidth = new PercentLength(1.0, base);
- Numeric labelEnd = refWidth;
- labelEnd = NumericOp.addition(labelEnd, NumericOp.negate(distance));
- labelEnd = NumericOp.addition(labelEnd, NumericOp.negate(startIndent));
- labelEnd = NumericOp.addition(labelEnd, separation);
-
+ Numeric labelEnd = distance;
+ labelEnd = NumericOp.addition(labelEnd, startIndent);
+ //TODO add start-intrusion-adjustment
+ labelEnd = NumericOp.subtraction(labelEnd, separation);
+
+ labelEnd = NumericOp.subtraction(refWidth, labelEnd);
+
return (Property) labelEnd;
}