if (this.marker == START) {
this.marker = 0;
}
// flow is *always* laid out into a BodyAreaContainer
BodyAreaContainer bac = (BodyAreaContainer)area;
boolean prevChildMustKeepWithNext = false;
Vector pageMarker = this.getMarkerSnapshot(new Vector());
int numChildren = this.children.size();
if (numChildren == 0) {
throw new FOPException("fo:flow must contain block-level children");
}
for (int i = this.marker; i < numChildren; i++) {
FObj fo = (FObj)children.elementAt(i);
if (bac.isBalancingRequired(fo)) {
// reset the the just-done span area in preparation
// for a backtrack for balancing
bac.resetSpanArea();
this.rollback(markerSnapshot);
// one less because of the "continue"
i = this.marker - 1;
continue;
}
// current column area
Area currentArea = bac.getNextArea(fo);
// temporary hack for IDReferences
currentArea.setIDReferences(bac.getIDReferences());
if (bac.isNewSpanArea()) {
this.marker = i;
markerSnapshot = this.getMarkerSnapshot(new Vector());
}
// Set current content width for percent-based lengths in children
setContentWidth(currentArea.getContentWidth());
_status = fo.layout(currentArea);
/*
* if((_status.isPageBreak() || i == numChildren - 1) && bac.needsFootnoteAdjusting()) {
* bac.adjustFootnoteArea();
* this.rollback(pageMarker);
* i = this.marker - 1;
* Area mainReferenceArea = bac.getMainReferenceArea();
* // remove areas
* continue;
* }
*/
if (_status.isIncomplete()) {
if ((prevChildMustKeepWithNext) && (_status.laidOutNone())) {
this.marker = i - 1;
FObj prevChild = (FObj)children.elementAt(this.marker);
prevChild.removeAreas();
prevChild.resetMarker();
prevChild.removeID(area.getIDReferences());
_status = new Status(Status.AREA_FULL_SOME);
return _status;
// should probably return AREA_FULL_NONE if first
// or perhaps an entirely new status code
}
if (bac.isLastColumn())
if (_status.getCode() == Status.FORCE_COLUMN_BREAK) {
this.marker = i;
_status =
new Status(Status.FORCE_PAGE_BREAK); // same thing
return _status;