* @param flowBPD the constant available block-progression-dimension (used for every part)
*/
public void doLayout(int flowBPD) {
+ doLayout(flowBPD, false);
+ }
+
+ /**
+ * Starts the page breaking process.
+ * @param flowBPD the constant available block-progression-dimension (used for every part)
+ * @param autoHeight true if warnings about overflows should be disabled because the
+ * the BPD is really undefined (for footnote-separators, for example)
+ */
+ public void doLayout(int flowBPD, boolean autoHeight) {
LayoutContext childLC = createLayoutContext();
childLC.setStackLimit(new MinOptMax(flowBPD));
PageBreakingAlgorithm alg = new PageBreakingAlgorithm(getTopLevelLM(),
getPageProvider(),
alignment, alignmentLast, footnoteSeparatorLength,
- isPartOverflowRecoveryActivated());
+ isPartOverflowRecoveryActivated(), autoHeight);
int iOptPageCount;
BlockSequence effectiveList;
boolean partOverflowRecovery,\r
int columnCount) {\r
super(topLevelLM, pageProvider, alignment, alignmentLast, \r
- footnoteSeparatorLength, partOverflowRecovery);\r
+ footnoteSeparatorLength, partOverflowRecovery, false);\r
this.columnCount = columnCount;\r
this.considerTooShort = true; //This is important!\r
}\r
private int storedBreakIndex = -1;
private boolean storedValue = false;
+ //Controls whether overflows should be warned about or not
+ private boolean autoHeight = false;
+
public PageBreakingAlgorithm(LayoutManager topLevelLM,
PageSequenceLayoutManager.PageProvider pageProvider,
int alignment, int alignmentLast,
MinOptMax footnoteSeparatorLength,
- boolean partOverflowRecovery) {
+ boolean partOverflowRecovery, boolean autoHeight) {
super(alignment, alignmentLast, true, partOverflowRecovery, 0);
this.topLevelLM = topLevelLM;
this.pageProvider = pageProvider;
if (footnoteSeparatorLength.min == footnoteSeparatorLength.max) {
footnoteSeparatorLength.max += 10000;
}
+ this.autoHeight = autoHeight;
}
/**
// ? bestActiveNode.difference : bestActiveNode.difference + fillerMinWidth;
int difference = bestActiveNode.difference;
if (difference + bestActiveNode.availableShrink < 0) {
- if (log.isWarnEnabled()) {
+ if (!autoHeight && log.isWarnEnabled()) {
log.warn(FONode.decorateWithContextInfo(
"Part/page " + (getPartCount() + 1)
+ " overflows the available area in block-progression dimension.",
int targetIPD = 0;
int targetBPD = 0;
int targetAlign = EN_AUTO;
+ boolean autoHeight = false;
StaticContentBreaker breaker;
if (getStaticContentFO().getFlowName().equals("xsl-footnote-separator")) {
targetIPD = targetBlock.getIPD();
targetBPD = targetBlock.getBPD();
+ if (targetBPD == 0) {
+ autoHeight = true;
+ }
targetAlign = EN_BEFORE;
} else {
targetIPD = targetRegion.getIPD();
setContentAreaIPD(targetIPD);
setContentAreaBPD(targetBPD);
breaker = new StaticContentBreaker(this, targetIPD, targetAlign);
- breaker.doLayout(targetBPD);
+ breaker.doLayout(targetBPD, autoHeight);
if (breaker.isOverflow()) {
- if (!getStaticContentFO().getFlowName().equals("xsl-footnote-separator")
- && regionFO.getOverflow() == EN_ERROR_IF_OVERFLOW) {
- //TODO throw layout exception
+ if (!autoHeight) {
+ //Overflow handling
+ if (regionFO.getOverflow() == EN_ERROR_IF_OVERFLOW) {
+ //TODO throw layout exception
+ }
+ log.warn("static-content overflows the available area.");
}
- log.warn("static-content overflows the available area.");
}
}