From 33361021ce600cac106a46831b8ade6912e87e17 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Tue, 2 Aug 2005 15:58:31 +0000 Subject: [PATCH] Fix for table-body4.xml. Higher penalty values for breaks that would results in unwelcome table breaks. At the moment this is hard-coded to an arbitrary value and needs to be refined. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@227030 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/table/TableStepper.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java index 9557a5de7..272afdf18 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java @@ -324,10 +324,20 @@ public class TableStepper { } } int p = 0; + boolean allCellsHaveContributed = true; signalKeepWithNext = false; for (int i = 0; i < start.length; i++) { + if (start[i] == 0 && end[i] < 0 && elementLists[i] != null) { + allCellsHaveContributed = false; + } signalKeepWithNext |= keepWithNextSignals[i]; } + if (!allCellsHaveContributed) { + //Not all cells have contributed to a newly started row. The penalty here is + //used to avoid breaks resulting in badly broken tables. + //See also: http://marc.theaimsgroup.com/?t=112248999600005&r=1&w=2 + p = 900; //KnuthPenalty.INFINITE; //TODO Arbitrary value. Please refine. + } if (signalKeepWithNext || getTableLM().mustKeepTogether()) { p = KnuthPenalty.INFINITE; } -- 2.39.5