]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix: Fixes table-cell7 where padding wasn't handled correctly while adding table...
authorJeremias Maerki <jeremias@apache.org>
Thu, 28 Jul 2005 21:22:37 +0000 (21:22 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 28 Jul 2005 21:22:37 +0000 (21:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@225893 13f79535-47bb-0310-9956-ffa450edef68

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

index 1fad67657d510ec96fae50976a8e160ddd9579c2..df32b143b3239a6f9e18a8ce8992b826b32fb937 100644 (file)
@@ -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;