]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix for table-body4.xml. Higher penalty values for breaks that would results in unwel...
authorJeremias Maerki <jeremias@apache.org>
Tue, 2 Aug 2005 15:58:31 +0000 (15:58 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 2 Aug 2005 15:58:31 +0000 (15:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@227030 13f79535-47bb-0310-9956-ffa450edef68

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

index 9557a5de7b401d6c2c925f892671f160a512847e..272afdf18d2800853747447e354c96a473b66ac1 100644 (file)
@@ -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;
             }