// needed to split the box at all. Just let it end naturally is enough for
// them to look good.
// As the real context (from the break-State) is currently being built,
// we have to use the original pool to query the 'is-end-of-line' flag.
RenderBox context = breakState.getInsertationPoint();
final BlockRenderBox lines = breakState.getLines();
while (context != lines)
{
// save the context ..
if (context instanceof InlineRenderBox == false)
{
throw new IllegalStateException
("Confused: I expect InlineBoxes ..");
}
final InlineRenderBox inline = (InlineRenderBox) context;
contexts.push(inline.split(RenderNode.HORIZONTAL_AXIS));
context = context.getParent();
}
// reset to a known state and add all saved contexts ..
breakState.setInsertationPoint(lines);
while (contexts.isEmpty() == false)
{
final RenderBox box = (RenderBox) contexts.pop();
breakState.getInsertationPoint().addGeneratedChild(box);
breakState.setInsertationPoint(box);
}
breakState.setBreakRequested(false);