aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache
diff options
context:
space:
mode:
authorKaren Lease <klease@apache.org>2001-10-14 20:39:54 +0000
committerKaren Lease <klease@apache.org>2001-10-14 20:39:54 +0000
commit7fcdab2487519faa410d53f47d3adf5cd89648aa (patch)
tree8c939bcf945786ec3b3f24f9659363136ce6455e /src/org/apache
parent29a6656aaf8b96c1adb8e83279c197aa445d9921 (diff)
downloadxmlgraphics-fop-7fcdab2487519faa410d53f47d3adf5cd89648aa.tar.gz
xmlgraphics-fop-7fcdab2487519faa410d53f47d3adf5cd89648aa.zip
Make it possible to use percentages to specify Length values for flow and static-content children
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194508 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache')
-rw-r--r--src/org/apache/fop/fo/flow/Flow.java15
-rw-r--r--src/org/apache/fop/fo/flow/StaticContent.java1
2 files changed, 12 insertions, 4 deletions
diff --git a/src/org/apache/fop/fo/flow/Flow.java b/src/org/apache/fop/fo/flow/Flow.java
index e2819fb14..9846c86d7 100644
--- a/src/org/apache/fop/fo/flow/Flow.java
+++ b/src/org/apache/fop/fo/flow/Flow.java
@@ -54,6 +54,11 @@ public class Flow extends FObj {
*/
private String _flowName;
+ /**
+ * Content-width of current column area during layout
+ */
+ private int contentWidth;
+
private Status _status = new Status(Status.AREA_FULL_NONE);
@@ -145,6 +150,8 @@ public class Flow extends FObj {
this.marker = i;
markerSnapshot = this.getMarkerSnapshot(new Vector());
}
+ // Set current content width for percent-based lengths in children
+ setContentWidth(currentArea.getContentWidth());
_status = fo.layout(currentArea);
@@ -200,15 +207,15 @@ public class Flow extends FObj {
return _status;
}
+ protected void setContentWidth(int contentWidth) {
+ this.contentWidth = contentWidth;
+ }
/**
* Return the content width of this flow (really of the region
* in which it is flowing).
*/
public int getContentWidth() {
- if (area != null)
- return area.getContentWidth(); // getAllocationWidth()??
- else
- return 0; // not laid out yet
+ return this.contentWidth;
}
protected String getElementName() {
diff --git a/src/org/apache/fop/fo/flow/StaticContent.java b/src/org/apache/fop/fo/flow/StaticContent.java
index 35a388432..9e50e242b 100644
--- a/src/org/apache/fop/fo/flow/StaticContent.java
+++ b/src/org/apache/fop/fo/flow/StaticContent.java
@@ -70,6 +70,7 @@ public class StaticContent extends Flow {
} else if (regionClass.equals(RegionAfter.REGION_CLASS)) {
area.setAbsoluteHeight(area.getPage().getBody().getMaxHeight());
}
+ setContentWidth(area.getContentWidth());
for (int i = 0; i < numChildren; i++) {
FObj fo = (FObj)children.elementAt(i);