From 40cebcc945e2ab04730e07b928b6be5789ce94a4 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 15 Jul 2005 20:52:47 +0000 Subject: Fix for allowing empty table-cells (for relaxed validation). Row heights were not always set, especially when there was no content to make the effective rows grow in height. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@219247 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/table/TableContentLayoutManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 4ac134309..72c44f2ad 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -455,7 +455,8 @@ public class TableContentLayoutManager { } ElementListObserver.observe(elems, "table-cell", primary.getCell().getId()); - if (((KnuthElement)elems.getLast()).isPenalty() + if ((elems.size() > 0) + && ((KnuthElement)elems.getLast()).isPenalty() && ((KnuthPenalty)elems.getLast()).getP() == -KnuthElement.INFINITE) { // a descendant of this block has break-after @@ -514,7 +515,6 @@ public class TableContentLayoutManager { if (effRowHeight > rowHeights[rgi].min) { //This is the new height of the (grid) row MinOptMaxUtil.extendMinimum(rowHeights[rgi], effRowHeight, false); - row.setHeight(rowHeights[rgi]); } } @@ -524,6 +524,7 @@ 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 " -- cgit v1.2.3