From 7ed67aba5bec4a02c3a9ef237e42d6a3d6136808 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Thu, 13 Dec 2007 18:28:56 +0000 Subject: Fixed the handling of columns in the border resolution, especially in case of column-spanning cells git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@603968 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/fo/flow/table/CollapsingBorderResolver.java | 14 +++++++++++--- src/java/org/apache/fop/fo/flow/table/TableCell.java | 11 ++--------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/java/org/apache/fop/fo/flow') diff --git a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java index f92f7bb30..f59019b92 100644 --- a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java +++ b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java @@ -205,14 +205,22 @@ class CollapsingBorderResolver implements BorderResolver { // Resolve start/end borders in the row Iterator guIter = row.iterator(); GridUnit gu = (GridUnit) guIter.next(); + Iterator colIter = table.getColumns().iterator(); + TableColumn col = (TableColumn) colIter.next(); + gu.integrateBorderSegment(CommonBorderPaddingBackground.START, col); gu.integrateBorderSegment(CommonBorderPaddingBackground.START, container); while (guIter.hasNext()) { - GridUnit guEnd = (GridUnit) guIter.next(); + GridUnit nextGU = (GridUnit) guIter.next(); + TableColumn nextCol = (TableColumn) colIter.next(); if (gu.isLastGridUnitColSpan()) { - gu.resolveBorder(guEnd, CommonBorderPaddingBackground.END); + gu.integrateBorderSegment(CommonBorderPaddingBackground.END, col); + nextGU.integrateBorderSegment(CommonBorderPaddingBackground.START, nextCol); + gu.resolveBorder(nextGU, CommonBorderPaddingBackground.END); } - gu = guEnd; + gu = nextGU; + col = nextCol; } + gu.integrateBorderSegment(CommonBorderPaddingBackground.END, col); gu.integrateBorderSegment(CommonBorderPaddingBackground.END, container); } diff --git a/src/java/org/apache/fop/fo/flow/table/TableCell.java b/src/java/org/apache/fop/fo/flow/table/TableCell.java index f85d0e97e..80dbe5e2a 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableCell.java +++ b/src/java/org/apache/fop/fo/flow/table/TableCell.java @@ -138,15 +138,8 @@ public class TableCell extends TableFObj { protected void setCollapsedBorders() { createBorder(CommonBorderPaddingBackground.BEFORE); createBorder(CommonBorderPaddingBackground.AFTER); - Table table = getTable(); - if (table.hasExplicitColumns()) { - TableColumn col = table.getColumn(getColumnNumber() - 1); - createBorder(CommonBorderPaddingBackground.START, col); - createBorder(CommonBorderPaddingBackground.END, col); - } else { - createBorder(CommonBorderPaddingBackground.START); - createBorder(CommonBorderPaddingBackground.END); - } + createBorder(CommonBorderPaddingBackground.START); + createBorder(CommonBorderPaddingBackground.END); } /** {@inheritDoc} */ -- cgit v1.2.3