From: Jeremias Maerki Date: Thu, 28 Jul 2005 21:22:37 +0000 (+0000) Subject: Bugfix: Fixes table-cell7 where padding wasn't handled correctly while adding table... X-Git-Tag: fop-0_90-alpha1~454 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cc831e2f48711a16e9130b9af6bb73c79f9c0da3;p=xmlgraphics-fop.git Bugfix: Fixes table-cell7 where padding wasn't handled correctly while adding table areas. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@225893 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 1fad67657..df32b143b 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -491,12 +491,17 @@ public class TableContentLayoutManager { effCellContentHeight = Math.max(effCellContentHeight, bpd.getMinimum().getLength().getValue()); } + if (!bpd.getOptimum().isAuto()) { + effCellContentHeight = Math.max(effCellContentHeight, + bpd.getOptimum().getLength().getValue()); + } if (gu.getRowSpanIndex() == 0) { //TODO ATM only non-row-spanned cells are taken for this MinOptMaxUtil.restrict(explicitRowHeights[rgi], bpd); } effCellContentHeight = Math.max(effCellContentHeight, primary.getContentLength()); + int borderWidths; if (isSeparateBorderModel()) { borderWidths = primary.getBorders().getBorderBeforeWidth(false) @@ -787,8 +792,27 @@ public class TableContentLayoutManager { gridUnits[i].getElements(), start[i], end[i]); partLength[i] = len; log.debug("len of part: " + len); - if (start[i] == 0 && lastRow.getExplicitHeight().min > 0) { - len = Math.max(len, lastRow.getExplicitHeight().opt); + if (start[i] == 0) { + LengthRangeProperty bpd = gridUnits[i].getCell() + .getBlockProgressionDimension(); + if (!bpd.getMinimum().isAuto()) { + if (bpd.getMinimum().getLength().getValue() > 0) { + len = Math.max(len, bpd.getMinimum().getLength().getValue()); + } + } + if (!bpd.getOptimum().isAuto()) { + if (bpd.getOptimum().getLength().getValue() > 0) { + len = Math.max(len, bpd.getOptimum().getLength().getValue()); + } + } + if (gridUnits[i].getRow() != null) { + bpd = gridUnits[i].getRow().getBlockProgressionDimension(); + if (!bpd.getMinimum().isAuto()) { + if (bpd.getMinimum().getLength().getValue() > 0) { + len = Math.max(len, bpd.getMinimum().getLength().getValue()); + } + } + } } //Now add the borders to the contentLength @@ -796,6 +820,8 @@ public class TableContentLayoutManager { len += gridUnits[i].getBorders().getBorderBeforeWidth(false); len += gridUnits[i].getBorders().getBorderAfterWidth(false); } + len += gridUnits[i].getBorders().getPaddingBefore(false); + len += gridUnits[i].getBorders().getPaddingAfter(false); int startRow = Math.max(gridUnits[i].getStartRow(), firstRow[bt]); Integer storedOffset = (Integer)rowOffsets[bt].get(new Integer(startRow)); int effYOffset;