diff options
author | arved <arved@unknown> | 2000-12-18 03:40:00 +0000 |
---|---|---|
committer | arved <arved@unknown> | 2000-12-18 03:40:00 +0000 |
commit | d1f9be5d9954b5be4e060e4ee3618abbbe6eef2f (patch) | |
tree | 7557b272741c58df98d2006abcf55106059cf22d /src/org | |
parent | 87e9f1320d65e2e8064824023862998bdb0f6b04 (diff) | |
download | xmlgraphics-fop-d1f9be5d9954b5be4e060e4ee3618abbbe6eef2f.tar.gz xmlgraphics-fop-d1f9be5d9954b5be4e060e4ee3618abbbe6eef2f.zip |
Slight mods
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193896 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/apache/fop/fo/pagination/RegionBody.java | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/src/org/apache/fop/fo/pagination/RegionBody.java b/src/org/apache/fop/fo/pagination/RegionBody.java index b8c6daa42..999620dcd 100644 --- a/src/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/org/apache/fop/fo/pagination/RegionBody.java @@ -53,8 +53,11 @@ package org.apache.fop.fo.pagination; // FOP import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.Overflow; import org.apache.fop.apps.FOPException; import org.apache.fop.layout.RegionArea; +import org.apache.fop.layout.BodyRegionArea; +import org.apache.fop.messaging.MessageHandler; public class RegionBody extends Region { @@ -83,16 +86,43 @@ public class RegionBody extends Region { int allocationRectangleYPosition, int allocationRectangleWidth, int allocationRectangleHeight) { - int marginTop = this.properties.get("margin-top").getLength().mvalue(); - int marginBottom = this.properties.get("margin-bottom").getLength().mvalue(); - int marginLeft = this.properties.get("margin-left").getLength().mvalue(); - int marginRight = this.properties.get("margin-right").getLength().mvalue(); + int marginTop = this.properties.get("margin-top").getLength().mvalue(); + int marginBottom = this.properties.get("margin-bottom").getLength().mvalue(); + int marginLeft = this.properties.get("margin-left").getLength().mvalue(); + int marginRight = this.properties.get("margin-right").getLength().mvalue(); - return new RegionArea(allocationRectangleXPosition + marginLeft, + BodyRegionArea body = new BodyRegionArea(allocationRectangleXPosition + marginLeft, allocationRectangleYPosition - marginTop, allocationRectangleWidth - marginLeft - marginRight, allocationRectangleHeight - - marginTop - marginBottom); + marginTop - marginBottom); + + int overflow = this.properties.get("overflow").getEnum(); + String columnCountAsString = this.properties.get("column-count").getString(); + int columnCount = 1; + try + { + columnCount = Integer.parseInt(columnCountAsString); + } + catch (NumberFormatException nfe) + { + MessageHandler.errorln("Bad value on region body 'column-count'"); + columnCount = 1; + } + if ((columnCount > 1) && (overflow == Overflow.SCROLL)) + { + // recover by setting 'column-count' to 1. This is allowed but + // not required by the spec. + MessageHandler.errorln("Setting 'column-count' to 1 because " + + "'overflow' is set to 'scroll'"); + columnCount = 1; + } + body.setColumnCount(columnCount); + + int columnGap = this.properties.get("column-gap").getLength().mvalue(); + body.setColumnGap(columnGap); + + return body; } protected String getDefaultRegionName() |