import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.layoutmgr.inline.InlineContainerLayoutManager;
import org.apache.fop.layoutmgr.inline.InlineLayoutManager;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.util.ListUtil;
public boolean handleOverflow(int milliPoints) {
if (getParent() instanceof BlockStackingLayoutManager) {
return ((BlockStackingLayoutManager) getParent()).handleOverflow(milliPoints);
+ } else if (getParent() instanceof InlineContainerLayoutManager) {
+ return ((InlineContainerLayoutManager) getParent()).handleOverflow(milliPoints);
}
return false;
}
private int contentAreaBPD;
private List<ListElement> childElements;
+ private int ipdOverflow;
private InlineViewport currentViewport;
private Container referenceArea;
} else {
contentAreaBPD = (int) Math.round(bpdValue);
if (contentAreaBPD < actualBPD) {
- BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
- fobj.getUserAgent().getEventBroadcaster());
- boolean canRecover = (((InlineContainer) fobj).getOverflow() != EN_ERROR_IF_OVERFLOW);
+ BlockLevelEventProducer eventProducer = getBlockLevelEventProducer();
eventProducer.viewportBPDOverflow(this, fobj.getName(),
- actualBPD - contentAreaBPD, needClip(), canRecover,
+ actualBPD - contentAreaBPD, needClip(), canRecoverFromOverflow(),
fobj.getLocator());
}
}
}
}
+ private BlockLevelEventProducer getBlockLevelEventProducer() {
+ return BlockLevelEventProducer.Provider.get(fobj.getUserAgent().getEventBroadcaster());
+ }
+
+ private boolean canRecoverFromOverflow() {
+ return ((InlineContainer) fobj).getOverflow() != EN_ERROR_IF_OVERFLOW;
+ }
+
private List<ListElement> getChildKnuthElements(LayoutContext layoutContext, int alignment) {
List<ListElement> allChildElements = new LinkedList<ListElement>();
LayoutManager childLM;
allChildElements.addAll(childElements);
// TODO breaks, keeps, empty content
}
+ handleIPDOverflow();
wrapPositions(allChildElements);
SpaceResolver.resolveElementList(allChildElements);
// TODO break-before, break-after
return allChildElements;
}
+ private void handleIPDOverflow() {
+ if (ipdOverflow > 0) {
+ BlockLevelEventProducer eventProducer = getBlockLevelEventProducer();
+ eventProducer.viewportIPDOverflow(this, fobj.getName(),
+ ipdOverflow, needClip(), canRecoverFromOverflow(),
+ fobj.getLocator());
+ }
+ }
+
private void wrapPositions(List<ListElement> elements) {
for (ListElement element : elements) {
Position position = new NonLeafPosition(this, element.getPosition());
context.getWritingMode());
}
+ public boolean handleOverflow(int milliPoints) {
+ ipdOverflow = Math.max(ipdOverflow, milliPoints);
+ return true;
+ }
+
public List addALetterSpaceTo(List oldList) {
throw new UnsupportedOperationException("Not implemented");
}