diff options
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r-- | src/java/org/apache/fop/area/AreaTreeParser.java | 5 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/Page.java | 14 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/RegionReference.java | 12 |
3 files changed, 15 insertions, 16 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeParser.java b/src/java/org/apache/fop/area/AreaTreeParser.java index 65587ec3d..580ce19f4 100644 --- a/src/java/org/apache/fop/area/AreaTreeParser.java +++ b/src/java/org/apache/fop/area/AreaTreeParser.java @@ -498,6 +498,7 @@ public class AreaTreeParser { transferForeignObjects(attributes, body); body.setCTM(getAttributeAsCTM(attributes, "ctm")); setAreaAttributes(attributes, body); + setTraits(attributes, body, SUBSET_BORDER_PADDING); rv.setRegionReference(body); currentPageViewport.getPage().setRegionViewport( Constants.FO_REGION_BODY, rv); @@ -939,6 +940,7 @@ public class AreaTreeParser { transferForeignObjects(attributes, reg); reg.setCTM(getAttributeAsCTM(attributes, "ctm")); setAreaAttributes(attributes, reg); + setTraits(attributes, reg, SUBSET_BORDER_PADDING); rv.setRegionReference(reg); currentPageViewport.getPage().setRegionViewport( side, rv); @@ -993,6 +995,9 @@ public class AreaTreeParser { Trait.PADDING_BEFORE, Trait.PADDING_AFTER, Trait.PADDING_START, Trait.PADDING_END, Trait.START_INDENT, Trait.END_INDENT, Trait.IS_REFERENCE_AREA, Trait.IS_VIEWPORT_AREA}; + private static final Object[] SUBSET_BORDER_PADDING = new Object[] { + Trait.BORDER_BEFORE, Trait.BORDER_AFTER, Trait.BORDER_START, Trait.BORDER_END, + Trait.PADDING_BEFORE, Trait.PADDING_AFTER, Trait.PADDING_START, Trait.PADDING_END}; private void setTraits(Attributes attributes, Area area, Object[] traitSubset) { for (int i = traitSubset.length; --i >= 0;) { diff --git a/src/java/org/apache/fop/area/Page.java b/src/java/org/apache/fop/area/Page.java index 167d28e6b..4607dfb74 100644 --- a/src/java/org/apache/fop/area/Page.java +++ b/src/java/org/apache/fop/area/Page.java @@ -128,8 +128,10 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { } // set borders and padding traits // (a little extensions wrt what prescribed by the specs at 6.4.14) - TraitSetter.addBorders(rr, r.getCommonBorderPaddingBackground(), false, false, false, false, null); - TraitSetter.addPadding(rr, r.getCommonBorderPaddingBackground(), false, false, false, false, null); + TraitSetter.addBorders(rr, r.getCommonBorderPaddingBackground(), + false, false, false, false, null); + TraitSetter.addPadding(rr, r.getCommonBorderPaddingBackground(), + false, false, false, false, null); setRegionReferencePosition(rr, r, rvp.getViewArea()); rvp.setRegionReference(rr); setRegionViewport(r.getNameId(), rvp); @@ -182,8 +184,12 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { FODimension reldims = new FODimension(0, 0); rr.setCTM(CTM.getCTMandRelDims(r.getReferenceOrientation(), r.getWritingMode(), absRegVPRect, reldims)); - rr.setIPD(reldims.ipd); - rr.setBPD(reldims.bpd); + rr.setIPD(reldims.ipd + - rr.getBorderAndPaddingWidthStart() + - rr.getBorderAndPaddingWidthEnd()); + rr.setBPD(reldims.bpd + - rr.getBorderAndPaddingWidthBefore() + - rr.getBorderAndPaddingWidthAfter()); } /** diff --git a/src/java/org/apache/fop/area/RegionReference.java b/src/java/org/apache/fop/area/RegionReference.java index bee597673..200f0bff3 100644 --- a/src/java/org/apache/fop/area/RegionReference.java +++ b/src/java/org/apache/fop/area/RegionReference.java @@ -73,18 +73,6 @@ public class RegionReference extends Area implements Cloneable { blocks.add(child); } - /** {@inheritDoc} */ - public int getBPD() { - // subtract bpd of borders and padding before / after - return super.getBPD() - getBorderAndPaddingWidthBefore() - getBorderAndPaddingWidthAfter(); - } - - /** {@inheritDoc} */ - public int getIPD() { - // subtract ipd of borders and padding start / end - return super.getIPD() - getBorderAndPaddingWidthStart() - getBorderAndPaddingWidthEnd(); - } - /** * Set the Coordinate Transformation Matrix which transforms content * coordinates in this region reference area which are specified in |