On Sep 18, 2005, at 21:58, Finn Bock wrote:

Hi Finn,

+        if( pList.getExplicit(PR_COLUMN_NUMBER) != null ) {
+            ((TableFObj) parent).setCurrentColumnIndex(
+ pList.getExplicit(PR_COLUMN_NUMBER).getNumeric().getValue());
+        }

Why is explit specified values different? In all other cases in FOP, the fo object only needs the computed values.

Normally, if the value wasn't explicitly specified and the column-number received the initial value in ColumnNumberPropertyMaker (via the call to getCurrentColumnIndex()), the current column index for the parent at that point --whether it's a TableRow or a TableBody-- will obviously be the very same as the property's value.

It's only in the case where a column-number was explicitly specified on the FO, that the parent's columnIndex will be 'out-of-sync'. The column-number for the next cell should be the current cell's column-number plus it's number-columns-spanned. The 'plus number-columns-spanned' part is dealt with automatically when the cell is added to the parent's list of child nodes.

Earlier on, I had tried to solve this by comparing the current cell's column-number with the parent's columnIndex, but this didn't work for all cases... So I needed a way to check whether the value was generated as a default, and bumped into getExplicit() which turned out to be the answer.

But I think I know what you mean: apart from the check *whether* the explicit value is null,
maybe it's better to use

Sorry, I have a tendency to make things more complicated than they actually are :-)

Does this address your concern?



Reply via email to