Lines 243-281
Link Here
|
243 |
private void addColumnNode(TableColumn col) throws FOPException { |
243 |
private void addColumnNode(TableColumn col) throws FOPException { |
244 |
int colNumber = col.getColumnNumber(); |
244 |
int colNumber = col.getColumnNumber(); |
245 |
int colRepeat = col.getNumberColumnsRepeated(); |
245 |
int colRepeat = col.getNumberColumnsRepeated(); |
|
|
246 |
int colSpan = col.getNumberColumnsSpanned(); |
246 |
if (columns == null) { |
247 |
if (columns == null) { |
247 |
columns = new java.util.ArrayList(); |
248 |
columns = new java.util.ArrayList(); |
248 |
} |
249 |
} |
249 |
if (columns.size() < colNumber) { |
250 |
for (int repCount = 0; repCount < colRepeat; ++repCount) { |
250 |
//add nulls for non-occupied indices between |
251 |
// if it is a repetition than force new column-number |
251 |
//the last column up to and including the current one |
252 |
if (repCount > 0) { |
252 |
while (columns.size() < colNumber) { |
253 |
colNumber += colSpan; |
253 |
columns.add(null); |
254 |
//col = (TableColumn)col.clone(this, false); |
|
|
255 |
col.forceColumnNumber(colNumber); |
254 |
} |
256 |
} |
255 |
} |
|
|
256 |
//replace the null-value with the actual column |
257 |
columns.set(colNumber - 1, col); |
258 |
if (colRepeat > 1) { |
259 |
//in case column is repeated: |
260 |
//for the time being, add the same column |
261 |
//(colRepeat - 1) times to the columns list |
262 |
//TODO: need to force the column-number |
263 |
//TODO: need to make sure START/END BorderInfo |
257 |
//TODO: need to make sure START/END BorderInfo |
264 |
// are completely independent instances (clones?) |
258 |
// are completely independent instances (clones?) |
265 |
// = necessary for border-collapse="collapse" |
259 |
// = necessary for border-collapse="collapse" |
266 |
// if collapsing is handled in FOTree |
260 |
// if collapsing is handled in FOTree |
267 |
for (int i = colRepeat - 1; --i >= 0;) { |
261 |
//add nulls for non-occupied indices between |
268 |
columns.add(col); |
262 |
//the last column up to and including the current one |
|
|
263 |
while (columns.size() < colNumber + colSpan - 1) { |
264 |
columns.add(null); |
269 |
} |
265 |
} |
|
|
266 |
//replace the null-value with the actual column |
267 |
columns.set(colNumber - 1, col); |
268 |
// flag the column index used by this column |
269 |
// and check for overlapping |
270 |
for (int i = 0; i < colSpan; ++i) { |
271 |
if (isColumnNumberUsed(colNumber + i)) { |
272 |
throw new FOPException("Xfo:table-column overlaps in column " |
273 |
+ colNumber, locator); |
274 |
} |
275 |
usedColumnIndices.set(colNumber - 1 + i); |
276 |
} |
270 |
} |
277 |
} |
271 |
//flag column indices used by this column |
278 |
|
272 |
for (int i = colNumber - 1; i < colNumber - 1 + colRepeat; i++) { |
|
|
273 |
usedColumnIndices.set(i); |
274 |
} |
275 |
//set index for the next column to use |
279 |
//set index for the next column to use |
276 |
while (usedColumnIndices.get(columnIndex - 1)) { |
280 |
columnIndex = colNumber + colSpan; |
277 |
columnIndex++; |
281 |
System.err.println("end addcolumn node"); |
278 |
} |
|
|
279 |
} |
282 |
} |
280 |
/** @return true of table-layout="auto" */ |
283 |
/** @return true of table-layout="auto" */ |
281 |
public boolean isAutoLayout() { |
284 |
public boolean isAutoLayout() { |