aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-01-30 19:28:59 +0000
committerJeremias Maerki <jeremias@apache.org>2009-01-30 19:28:59 +0000
commit5a32e5468b4df6fd33c76027f8f72385f8140373 (patch)
treeef2451e54e1b094df3c0051f829b0428029d5269 /src/java/org/apache/fop
parent77c49600624d70f8de7a19757342bd897c6de20f (diff)
downloadxmlgraphics-fop-5a32e5468b4df6fd33c76027f8f72385f8140373.tar.gz
xmlgraphics-fop-5a32e5468b4df6fd33c76027f8f72385f8140373.zip
Fixed test error for transcoders.
Enabled disabling strict validation from inside the test case. This enabled activating the border/padding test case for region references. Refactored layout engine and intermediate format tests a bit to increase code reuse. Fixed the way border/padding are set on the area tree. The current way had unwanted side-effects for the AreaTreeParser. Added support for border/padding on region references when parsing from area tree XML. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@739386 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/area/AreaTreeParser.java5
-rw-r--r--src/java/org/apache/fop/area/Page.java14
-rw-r--r--src/java/org/apache/fop/area/RegionReference.java12
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