List rawCols = table.getColumns();
if (rawCols != null) {
int colnum = 1;
ListIterator iter = rawCols.listIterator();
while (iter.hasNext()) {
TableColumn col = (TableColumn)iter.next();
if (col == null) {
continue;
}
colnum = col.getColumnNumber();
for (int i = 0; i < col.getNumberColumnsRepeated(); i++) {
while (colnum > columns.size()) {
columns.add(null);
}
columns.set(colnum - 1, col);
colnum++;
}
}
//Post-processing the list (looking for gaps)
//TODO The following block could possibly be removed
int pos = 1;
ListIterator ppIter = columns.listIterator();
while (ppIter.hasNext()) {
TableColumn col = (TableColumn)ppIter.next();
if (col == null) {
assert false; //Gaps are filled earlier by fo.flow.table.Table.finalizeColumns()
//log.error("Found a gap in the table-columns at position " + pos);
}
pos++;