]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix: update dx also for grid units having no border, in the addAreas method
authorVincent Hennebert <vhennebert@apache.org>
Thu, 19 Apr 2007 16:10:14 +0000 (16:10 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Thu, 19 Apr 2007 16:10:14 +0000 (16:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@530469 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java

index fabc508b114b8bfa43544a293b4f4f5b35ce3966..9c5700db1ad1a1ebe3d4794c0777367ef3f51966 100644 (file)
@@ -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());
                     }