if (breakBeforeStatus != Status.OK) {
return breakBeforeStatus;
}
}
NormalBlockArea blockArea;
if (! this.anythingLaidOut) {
this.noLayoutCount++;
}
if (this.noLayoutCount > this.infLoopThreshhold) {
throw new AreaTreeException(
"No meaningful layout in block after many attempts.\n"
+ "Infinite loop is assumed. Processing halted. Context:\n"
+ this.node.getContextMessage());
}
if (getProgress() == FONodePL.BREAK_AFTER) {
return Status.OK;
}
if (getProgress() == FONodePL.START) {
// Reset the "loop counter".
this.noLayoutCount = 0;
if (areaNode instanceof NormalBlockArea) {
getLayout().completeCurrentLineInBlock(
(NormalBlockArea) areaNode);
}
setProgress(0);
}
blockArea = bcArea.makeNormalBlockArea(this.node, graftingPoint);
for (int i = getProgress(); i < this.node.getChildCount(); i++) {
final Fo fo = this.node.getChildAt(i);
final FONodePL nodePL = this.getLayoutProxy(fo);
Status status = null;
boolean doneProcessingItem = false;
while (! doneProcessingItem) {
status = nodePL.layout(blockArea, graftingPoint);
if (! status.isIncomplete()
|| status.isPageBreak()) {
doneProcessingItem = true;
break;
}
this.currentLineArea = blockArea.makeLineArea(false);
if (this.currentLineArea == null) {
doneProcessingItem = true;
}
}