aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2007-04-19 16:10:14 +0000
committerVincent Hennebert <vhennebert@apache.org>2007-04-19 16:10:14 +0000
commitd7b52de1217c788f48a9c734c279484ddb02ca7d (patch)
tree0c6175dd3df09b4f9fe015ab07b235f5847f4c31 /src
parentf99c3b88a78d717ba835dd2ca8e8a9e8321c288b (diff)
downloadxmlgraphics-fop-d7b52de1217c788f48a9c734c279484ddb02ca7d.tar.gz
xmlgraphics-fop-d7b52de1217c788f48a9c734c279484ddb02ca7d.zip
Bugfix: update dx also for grid units having no border, in the addAreas method
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@530469 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
index fabc508b1..9c5700db1 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
@@ -390,38 +390,36 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
int dx = xoffset;
for (int x = 0; x < gridUnits.length; x++) {
GridUnit gu = gridUnits[x];
- if (!gu.hasBorders()) {
- continue;
+ if (gu.hasBorders()) {
+ //Blocks for painting grid unit borders
+ Block block = new Block();
+ block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
+ block.setPositioning(Block.ABSOLUTE);
+
+ int bpd = spannedGridRowHeights[y - startRow];
+ bpd -= gu.getBorders().getBorderBeforeWidth(false) / 2;
+ bpd -= gu.getBorders().getBorderAfterWidth(false) / 2;
+ block.setBPD(bpd);
+ if (log.isTraceEnabled()) {
+ log.trace("pgu: " + primaryGridUnit + "; gu: " + gu + "; yoffset: "
+ + (dy - gu.getBorders().getBorderBeforeWidth(false) / 2)
+ + "; bpd: " + bpd);
+ }
+ int ipd = gu.getColumn().getColumnWidth().getValue(
+ (PercentBaseContext) getParent());
+ int borderStartWidth = gu.getBorders().getBorderStartWidth(false) / 2;
+ ipd -= borderStartWidth;
+ ipd -= gu.getBorders().getBorderEndWidth(false) / 2;
+ block.setIPD(ipd);
+ block.setXOffset(dx + borderStartWidth);
+ block.setYOffset(dy - gu.getBorders().getBorderBeforeWidth(false) / 2);
+ outer[0] = gu.getFlag(GridUnit.FIRST_IN_TABLE);
+ outer[1] = gu.getFlag(GridUnit.LAST_IN_TABLE);
+ outer[2] = gu.getFlag(GridUnit.IN_FIRST_COLUMN);
+ outer[3] = gu.getFlag(GridUnit.IN_LAST_COLUMN);
+ TraitSetter.addCollapsingBorders(block, gu.getBorders(), outer, this);
+ parentLM.addChildArea(block);
}
-
- //Blocks for painting grid unit borders
- Block block = new Block();
- block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
- block.setPositioning(Block.ABSOLUTE);
-
- int bpd = spannedGridRowHeights[y - startRow];
- bpd -= gu.getBorders().getBorderBeforeWidth(false) / 2;
- bpd -= gu.getBorders().getBorderAfterWidth(false) / 2;
- block.setBPD(bpd);
- if (log.isTraceEnabled()) {
- log.trace("pgu: " + primaryGridUnit + "; gu: " + gu + "; yoffset: "
- + (dy - gu.getBorders().getBorderBeforeWidth(false) / 2)
- + "; bpd: " + bpd);
- }
- int ipd = gu.getColumn().getColumnWidth().getValue(
- (PercentBaseContext) getParent());
- int borderStartWidth = gu.getBorders().getBorderStartWidth(false) / 2;
- ipd -= borderStartWidth;
- ipd -= gu.getBorders().getBorderEndWidth(false) / 2;
- block.setIPD(ipd);
- block.setXOffset(dx + borderStartWidth);
- block.setYOffset(dy - gu.getBorders().getBorderBeforeWidth(false) / 2);
- outer[0] = gu.getFlag(GridUnit.FIRST_IN_TABLE);
- outer[1] = gu.getFlag(GridUnit.LAST_IN_TABLE);
- outer[2] = gu.getFlag(GridUnit.IN_FIRST_COLUMN);
- outer[3] = gu.getFlag(GridUnit.IN_LAST_COLUMN);
- TraitSetter.addCollapsingBorders(block, gu.getBorders(), outer, this);
- parentLM.addChildArea(block);
dx += gu.getColumn().getColumnWidth().getValue(
(PercentBaseContext) getParent());
}