]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Buzilla #35787
authorJeremias Maerki <jeremias@apache.org>
Tue, 19 Jul 2005 13:53:05 +0000 (13:53 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 19 Jul 2005 13:53:05 +0000 (13:53 +0000)
When checking for content overflow, don't include border and padding.
Clearer warning message in case of height constraint violation on table-rows.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@219685 13f79535-47bb-0310-9956-ffa450edef68

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

index 932e7be280ceba1370da6f2650b91f1a9884d2db..1fad67657d510ec96fae50976a8e160ddd9579c2 100644 (file)
@@ -406,6 +406,7 @@ public class TableContentLayoutManager {
             TableRow tableRow = null;
             int minContentHeight = 0;
             int maxCellHeight = 0;
+            int effRowContentHeight = 0;
             for (int j = 0; j < row.getGridUnits().size(); j++) {
                 maxColumnCount = Math.max(maxColumnCount, row.getGridUnits().size());
                 GridUnit gu = row.getGridUnit(j);
@@ -504,6 +505,8 @@ public class TableContentLayoutManager {
                             borderWidths = primary.getHalfMaxBorderWidth();
                         }
                         int padding = 0;
+                        effRowContentHeight = Math.max(effRowContentHeight,
+                                effCellContentHeight);
                         CommonBorderPaddingBackground cbpb 
                             = primary.getCell().getCommonBorderPaddingBackground(); 
                         padding += cbpb.getPaddingBefore(false);
@@ -526,11 +529,13 @@ public class TableContentLayoutManager {
 
             row.setHeight(rowHeights[rgi]);
             row.setExplicitHeight(explicitRowHeights[rgi]);
-            if (row.getHeight().opt > row.getExplicitHeight().max) {
-                log.warn("Contents of row " + row.getIndex() + " violate a maximum constraint "
-                        + "in block-progression-dimension. Due to its contents the row grows "
-                        + "to " + row.getHeight().opt + " millipoints. The row constraint resolve "
-                        + "to " + row.getExplicitHeight());
+            if (effRowContentHeight > row.getExplicitHeight().max) {
+                log.warn("The contents of row " + (row.getIndex() + 1) 
+                        + " are taller than they should be (there is a"
+                        + " block-progression-dimension or height constraint on the indicated row)."
+                        + " Due to its contents the row grows"
+                        + " to " + effRowContentHeight + " millipoints, but the row shouldn't get"
+                        + " any taller than " + row.getExplicitHeight() + " millipoints.");
             }
         }
         if (log.isDebugEnabled()) {