aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFinn Bock <bckfnn@apache.org>2004-01-29 19:39:26 +0000
committerFinn Bock <bckfnn@apache.org>2004-01-29 19:39:26 +0000
commit411c78ffa31608842ef7ecae845cb9cf3b854e41 (patch)
tree7b09c56400ccad6b503b97afb83cc39f4fe104ea /src
parent312993b66dba88c364833ee8a83c3b46740ce73c (diff)
downloadxmlgraphics-fop-411c78ffa31608842ef7ecae845cb9cf3b854e41.tar.gz
xmlgraphics-fop-411c78ffa31608842ef7ecae845cb9cf3b854e41.zip
A hack to calculate the startIndent and endIndent based on either margin
or startIndent. PR: 25802. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197293 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/fo/PropertyManager.java38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/fo/PropertyManager.java b/src/java/org/apache/fop/fo/PropertyManager.java
index cbb5f98fc..467254442 100644
--- a/src/java/org/apache/fop/fo/PropertyManager.java
+++ b/src/java/org/apache/fop/fo/PropertyManager.java
@@ -311,10 +311,40 @@ public class PropertyManager implements Constants {
getSpace().getOptimum().getLength().getValue();
props.spaceAfter = this.propertyList.get(PR_SPACE_AFTER).
getSpace().getOptimum().getLength().getValue();
- props.startIndent = this.propertyList.get(PR_START_INDENT).
- getLength().getValue();
- props.endIndent = this.propertyList.get(PR_END_INDENT).
- getLength().getValue();
+
+
+ // For now we do the section 5.3.2 calculation here.
+ // This is a hack that doesn't deal correctly with:
+ // - Reference vs. non-reference areas.
+ // - writing mode, it mixes start and left.
+ // - inherited values of margins and indents.
+ // When the indents properties calculate this values correctly,
+ // the block below can be removed and replaced with simple
+ // props.startIndent = this.propertyList.get(PR_START_INDENT)
+ // props.endIndent = this.propertyList.get(PR_END_INDENT)
+ CommonBorderAndPadding bpProps = getBorderAndPadding();
+
+ int startIndent = 0;
+ if (props.marginLeft != 0) {
+ startIndent = props.marginLeft;
+ } else {
+ startIndent = this.propertyList.get(PR_START_INDENT).
+ getLength().getValue();
+ }
+ props.startIndent = startIndent +
+ bpProps.getBorderStartWidth(false) +
+ bpProps.getPaddingStart(false);
+
+ int endIndent = 0;
+ if (props.marginRight != 0) {
+ endIndent = props.marginRight;
+ } else {
+ endIndent = this.propertyList.get(PR_END_INDENT).
+ getLength().getValue();
+ }
+ props.endIndent = endIndent +
+ bpProps.getBorderEndWidth(false) +
+ bpProps.getPaddingEnd(false);
return props;
}