From: Keiron Liddle Date: Mon, 5 Mar 2001 04:39:57 +0000 (+0000) Subject: properly adjusts the max height of table parts X-Git-Tag: fop-0_18_1~50 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=928450b7cb2d899aef957ebec1ebeba91e418fc4;p=xmlgraphics-fop.git properly adjusts the max height of table parts when a footnote is added table will not overlap with the footnote git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194138 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/fo/flow/Block.java b/src/org/apache/fop/fo/flow/Block.java index 62ff92594..582a79091 100644 --- a/src/org/apache/fop/fo/flow/Block.java +++ b/src/org/apache/fop/fo/flow/Block.java @@ -257,6 +257,9 @@ public class Block extends FObjMixed { } blockArea.end(); + + area.setMaxHeight(area.getMaxHeight() - spaceLeft + blockArea.getMaxHeight()); + area.addChild(blockArea); /* should this be combined into above? */ diff --git a/src/org/apache/fop/fo/flow/Table.java b/src/org/apache/fop/fo/flow/Table.java index 3c4afdf77..1cc52e316 100644 --- a/src/org/apache/fop/fo/flow/Table.java +++ b/src/org/apache/fop/fo/flow/Table.java @@ -155,6 +155,7 @@ public class Table extends FObj { area.getIDReferences().configureID(id, area); } + int spaceLeft = area.spaceLeft(); this.areaContainer = new AreaContainer(propMgr.getFontState(area.getFontInfo()), 0, 0, area.getAllocationWidth(), area.spaceLeft(), Position.STATIC); @@ -223,6 +224,7 @@ public class Table extends FObj { } addedHeader = true; tableHeader.resetMarker(); + area.setMaxHeight(area.getMaxHeight() - spaceLeft + this.areaContainer.getMaxHeight()); } if (tableFooter != null && !this.omitFooterAtBreak && !addedFooter) { if ((status = tableFooter.layout(areaContainer)). @@ -271,6 +273,7 @@ public class Table extends FObj { } else { bodyCount++; } + area.setMaxHeight(area.getMaxHeight() - spaceLeft + this.areaContainer.getMaxHeight()); if (tableFooter != null && !this.omitFooterAtBreak) { // move footer to bottom of area and move up body // space before and after footer will make this wrong diff --git a/src/org/apache/fop/fo/flow/TableBody.java b/src/org/apache/fop/fo/flow/TableBody.java index c9e6b28d0..83a7f5f0b 100644 --- a/src/org/apache/fop/fo/flow/TableBody.java +++ b/src/org/apache/fop/fo/flow/TableBody.java @@ -143,6 +143,7 @@ public class TableBody extends FObj { area.getIDReferences().configureID(id, area); } + int spaceLeft = area.spaceLeft(); this.areaContainer = new AreaContainer(propMgr.getFontState(area.getFontInfo()), -area.getBorderLeftWidth(), -area.getBorderTopWidth() + area.getHeight(), @@ -260,6 +261,7 @@ public class TableBody extends FObj { endKeepGroup = true; } lastRow = row; + area.setMaxHeight(area.getMaxHeight() - spaceLeft + this.areaContainer.getMaxHeight()); } area.addChild(areaContainer); areaContainer.end(); diff --git a/src/org/apache/fop/fo/flow/TableCell.java b/src/org/apache/fop/fo/flow/TableCell.java index 311fca76e..097ebd56a 100644 --- a/src/org/apache/fop/fo/flow/TableCell.java +++ b/src/org/apache/fop/fo/flow/TableCell.java @@ -163,6 +163,7 @@ public class TableCell extends FObj { area.getIDReferences().configureID(id,area); } + int spaceLeft = area.spaceLeft(); this.areaContainer = new AreaContainer(propMgr.getFontState(area.getFontInfo()), startOffset - area.getBorderLeftWidth(), @@ -195,6 +196,7 @@ public class TableCell extends FObj { return new Status(Status.AREA_FULL_SOME); } } + area.setMaxHeight(area.getMaxHeight() - spaceLeft + this.areaContainer.getMaxHeight()); } areaContainer.end(); area.addChild(areaContainer); diff --git a/src/org/apache/fop/fo/flow/TableRow.java b/src/org/apache/fop/fo/flow/TableRow.java index 063eec1d9..83387d450 100644 --- a/src/org/apache/fop/fo/flow/TableRow.java +++ b/src/org/apache/fop/fo/flow/TableRow.java @@ -324,6 +324,7 @@ public class TableRow extends FObj { area.getIDReferences().configureID(id, area); } + int spaceLeft = area.spaceLeft(); this.areaContainer = new AreaContainer(propMgr.getFontState(area.getFontInfo()), -area.getBorderLeftWidth(), -area.getBorderTopWidth(), area.getAllocationWidth(), @@ -473,6 +474,8 @@ public class TableRow extends FObj { } } + area.setMaxHeight(area.getMaxHeight() - spaceLeft + this.areaContainer.getMaxHeight()); + for (int i = 0; i < numChildren; i++) { TableCell cell = (TableCell) children.elementAt(i); cell.setRowHeight(largestCellHeight);