Vector columns = new Vector();
int currentColumnNumber = 0;
+ int bodyCount = 0;
AreaContainer areaContainer;
int offset = 0;
boolean addedHeader = false;
+ boolean addedFooter = false;
int numChildren = this.children.size();
for (int i = this.marker; i < numChildren; i++) {
FONode fo = (FONode) children.elementAt(i);
addedHeader = true;
tableHeader.resetMarker();
}
- if (tableFooter != null && !this.omitFooterAtBreak) {
+ if (tableFooter != null && !this.omitFooterAtBreak && !addedFooter) {
if ((status = tableFooter.layout(areaContainer)).
isIncomplete()) {
return new Status(Status.AREA_FULL_NONE);
}
+ addedFooter = true;
tableFooter.resetMarker();
}
fo.setWidows(widows);
if ((status = fo.layout(areaContainer)).isIncomplete()) {
this.marker = i;
- if (status.getCode() == Status.AREA_FULL_NONE) {
+ if (bodyCount == 0 && status.getCode() == Status.AREA_FULL_NONE) {
if (tableHeader != null)
tableHeader.removeLayout(areaContainer);
if (tableFooter != null)
tableFooter.removeLayout(areaContainer);
+ resetMarker();
// status = new Status(Status.AREA_FULL_SOME);
}
//areaContainer.end();
tableFooter.getYPosition() +
((TableBody) fo).getHeight());
}
+ status = new Status(Status.AREA_FULL_SOME);
}
return status;
+ } else {
+ bodyCount++;
}
if (tableFooter != null && !this.omitFooterAtBreak) {
// move footer to bottom of area and move up body
DisplaySpace spacer = null;
boolean hasAddedSpacer = false;
DisplaySpace spacerAfter = null;
+ boolean areaAdded = false;
/**
* The list of cell states for this row. This is the location of
}
} else {
// added on 11/28/2000, by Dresdner Bank, Germany
- if (hasAddedSpacer && spacer != null)
+ if (spacer != null) {
area.removeChild(spacer);
+ spacer = null;
+ }
hasAddedSpacer = false;
if(spacerAfter != null)
area.removeChild(spacerAfter);
+ spacerAfter = null;
// removing something that was added by succession
// of cell.layout()
}
area.addChild(areaContainer);
+ areaAdded = true;
areaContainer.end();
area.addDisplaySpace(largestCellHeight +
areaContainer.getPaddingTop() +
if (!someCellDidNotLayoutCompletely && spaceAfter != 0) {
spacerAfter = new DisplaySpace(spaceAfter);
- area.increaseHeight(spaceAfter);
area.addChild(spacerAfter);
+ area.increaseHeight(spaceAfter);
}
if (area instanceof BlockArea) {
area.increaseHeight(-spaceBefore);
}
}
- hasAddedSpacer = false;
if(spacerAfter != null)
area.removeChild(spacerAfter);
//area.increaseHeight(areaContainer.getHeight());
- area.removeChild(areaContainer);
+ if(areaAdded)
+ area.removeChild(areaContainer);
+ areaAdded = false;
this.resetMarker();
cells = null;
this.removeID(area.getIDReferences());