if (getProgress() == FONodePL.START) {
setProgress(0);
}
// flow is *always* laid out into a BodyAreaContainer
final RegionBodyRefArea bac = (RegionBodyRefArea) areaNode;
boolean prevChildMustKeepWithNext = false;
final int numChildren = getFONode().getChildCount();
for (int i = getProgress(); i < numChildren; i++) {
final Fo fo = getFONode().getChildAt(i);
if (bac.getMainRefArea().isBalancingRequired(fo)) {
// reset the the just-done span area in preparation
// for a backtrack for balancing
bac.getMainRefArea().resetSpanArea();
rollback(getProgressSnapshot());
// one less because of the "continue"
i = getProgress() - 1;
continue;
}
// current column area
final Area currentArea = bac.getMainRefArea().getNormalFlow(fo);
if (bac.getMainRefArea().isNewSpanArea()) {
setProgress(i);
setProgressSnapshot(getProgressSnapshot(new
ArrayList<Integer>()));
}
setStatus(getLayoutProxy(fo).layout(currentArea, graftingPoint));
if (getStatus().isIncomplete()) {
if (prevChildMustKeepWithNext
&& (getStatus().laidOutNone())) {
setProgress(i - 1);
final Fo prevChild = getFONode().getChildAt(getProgress());
final FObjPL prevChildPL = (FObjPL) getLayoutProxy(
prevChild);
prevChildPL.resetProgress();
setStatus(Status.AREA_FULL_SOME);
return getStatus();
// should probably return AREA_FULL_NONE if first
// or perhaps an entirely new status code
}
if (bac.getMainRefArea().isLastColumn()) {
if (getStatus() == Status.FORCE_COLUMN_BREAK) {
setProgress(i);
// same thing
setStatus(Status.FORCE_PAGE_BREAK);
return getStatus();