*/
private int width;
private int remainingLength;
- private int baseWidth;
+ private int previousRowsLength;
private int totalLength;
private int includedLength;
private int borderBefore;
private boolean keepWithNextSignal;
private int lastPenaltyLength;
- ActiveCell(PrimaryGridUnit pgu, EffRow row, int rowIndex, EffRow[] rowGroup, TableLayoutManager tableLM) {
+ ActiveCell(PrimaryGridUnit pgu, EffRow row, int rowIndex, int previousRowsLength, TableLayoutManager tableLM) {
this.pgu = pgu;
boolean makeBoxForWholeRow = false;
if (row.getExplicitHeight().min > 0) {
// log.trace("column " + (column+1) + ": recording " + elementLists.size() + " element(s)");
// }
}
+ includedLength = -1; // Avoid troubles with cells having content of zero length
+ this.previousRowsLength = previousRowsLength;
+ width = previousRowsLength;
totalLength = ElementListUtils.calcContentLength(elementList);
if (pgu.getTable().isSeparateBorderModel()) {
borderBefore = pgu.getBorders().getBorderBeforeWidth(false)
end = -1;
startRow = rowIndex;
keepWithNextSignal = false;
- computeBaseWidth(rowGroup);
remainingLength = totalLength;
goToNextLegalBreak();
}
- private void computeBaseWidth(EffRow[] rowGroup) {
- width = 0;
- includedLength = -1; // Avoid troubles with cells having content of zero length
- for (int prevRow = 0; prevRow < startRow; prevRow++) {
- width += rowGroup[prevRow].getHeight().opt;
- }
- baseWidth = width;
- }
-
boolean endsOnRow(int rowIndex) {
return rowIndex == startRow + pgu.getCell().getNumberRowsSpanned() - 1;
}
computeRemainingLength();
return false;
} else {
- return baseWidth + borderBefore + borderAfter + paddingBefore + paddingAfter > minStep;
+ return previousRowsLength + borderBefore + borderAfter + paddingBefore + paddingAfter > minStep;
}
}
/** Number of columns in the row group. */
private int columnCount;
private int totalHeight;
+ private int previousRowsLength = 0;
private int activeRowIndex;
private boolean rowBacktrackForLastStep;
private boolean skippedStep;
for (int i = 0; i < columnCount; i++) {
GridUnit gu = getActiveGridUnit(i);
if (gu != null && !gu.isEmpty() && gu.isPrimary()) {
- activeCells.add(new ActiveCell((PrimaryGridUnit) gu, row, activeRowIndex, rowGroup, getTableLM()));
+ activeCells.add(new ActiveCell((PrimaryGridUnit) gu, row, activeRowIndex, previousRowsLength, getTableLM()));
}
}
}
"break-after ignored on table-row because of row spanning "
+ "in progress (See XSL 1.0, 7.19.1)", rowFO));
}
+ previousRowsLength += rowGroup[activeRowIndex].getHeight().opt;
activeRowIndex++;
if (log.isDebugEnabled()) {
log.debug("===> new row: " + activeRowIndex);