diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-08-02 15:58:31 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-08-02 15:58:31 +0000 |
commit | 33361021ce600cac106a46831b8ade6912e87e17 (patch) | |
tree | e74e499a9c33e49897b250b879070e9238abf33c /src/java/org/apache/fop/layoutmgr | |
parent | c3ac1e33bfd8a82feccc923dd4ba73e2c8e76274 (diff) | |
download | xmlgraphics-fop-33361021ce600cac106a46831b8ade6912e87e17.tar.gz xmlgraphics-fop-33361021ce600cac106a46831b8ade6912e87e17.zip |
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
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/table/TableStepper.java | 10 |
1 files changed, 10 insertions, 0 deletions
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; } |