MinOptMax[] rowHeights = new MinOptMax[rowGroup.length];
MinOptMax[] explicitRowHeights = new MinOptMax[rowGroup.length];
EffRow row;
- int maxColumnCount = 0;
List pgus = new java.util.ArrayList(); //holds a list of a row's primary grid units
for (int rgi = 0; rgi < rowGroup.length; rgi++) {
row = rowGroup[rgi];
// The BPD of the biggest cell in the row
int maxCellBPD = 0;
for (int j = 0; j < row.getGridUnits().size(); j++) {
- assert maxColumnCount == 0 || maxColumnCount == row.getGridUnits().size();
- maxColumnCount = Math.max(maxColumnCount, row.getGridUnits().size());
GridUnit gu = row.getGridUnit(j);
if ((gu.isPrimary() || (gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan()))
&& !gu.isEmpty()) {
log.debug(" height=" + rowHeights[i] + " explicit=" + explicitRowHeights[i]);
}
}
- LinkedList returnedList = tableStepper.getCombinedKnuthElementsForRowGroup(
- context, rowGroup, maxColumnCount, bodyType);
+ LinkedList returnedList = tableStepper.getCombinedKnuthElementsForRowGroup(context,
+ rowGroup, bodyType);
if (returnedList != null) {
returnList.addAll(returnedList);
}
*/
public TableStepper(TableContentLayoutManager tclm) {
this.tclm = tclm;
+ this.columnCount = tclm.getTableLM().getTable().getNumberOfColumns();
}
/**
* Initializes the fields of this instance to handle a new row group.
*
- * @param columnCount number of columns the row group has
+ * @param rowGroup the new row group to handle
*/
- private void setup(int columnCount) {
- this.columnCount = columnCount;
+ private void setup(EffRow[] rowGroup) {
+ this.rowGroup = rowGroup;
this.activeRowIndex = 0;
this.previousRowsLength = 0;
}
* Creates the combined element list for a row group.
* @param context Active LayoutContext
* @param rowGroup the row group
- * @param maxColumnCount the maximum number of columns to expect
* @param bodyType Indicates what type of body is processed (body, header or footer)
* @return the combined element list
*/
- public LinkedList getCombinedKnuthElementsForRowGroup(
- LayoutContext context,
- EffRow[] rowGroup, int maxColumnCount, int bodyType) {
- this.rowGroup = rowGroup;
- setup(maxColumnCount);
+ public LinkedList getCombinedKnuthElementsForRowGroup(LayoutContext context, EffRow[] rowGroup,
+ int bodyType) {
+ setup(rowGroup);
initializeElementLists();
calcTotalHeight();
boolean forcedBreak = false;
int breakClass = -1;
//Put all involved grid units into a list
- List cellParts = new java.util.ArrayList(maxColumnCount);
+ List cellParts = new java.util.ArrayList(columnCount);
for (Iterator iter = activeCells.iterator(); iter.hasNext();) {
ActiveCell activeCell = (ActiveCell) iter.next();
CellPart part = activeCell.createCellPart();