Hi,

> Author: jeremias
> Date: Fri Aug 29 09:36:17 2008
> New Revision: 690319
> 
> URL: http://svn.apache.org/viewvc?rev=690319&view=rev
> Log:
> Added missing generation of areas for empty grid units in tables with 
> collapsing border model.
<snip/>

I’m not happy with that change. Basically it’s code copy-pasted from
several places and slightly modified to handle missing cells. I didn’t
spend months trying to clean up the table layout code to see that kind
of change introduced at the first opportunity...

A bit of background first: distinction needs to be made between /empty/
cells (existing table-cell elements with no content), and /missing/
cells (missing table-cell element; e.g., only three cells on a row in
a four-column table). The EmptyGridUnit class is meant to handle that
latter case only (yes, it’s misnamed). I didn’t have the opportunity of
addressing that issue when I worked on tables, so I left it as is.

That EmptyGridUnit class doesn’t fit well in the big picture. It
constantly requires special care just because you can’t get a non-null
TableCell object from it. The only way I could think of to handle that
properly is to ‘fix’ the FO tree, completing it by adding empty
table-cell elements. Basically in FixedColRowGroupBuilder.endRow(),
instead of filling the gaps with EmptyGridUnit objects, proper TableCell
objects would be created in some way.

To achieve that we need to be able to create FONode objects outside of
the FOTreeBuilder machinery. Or to trigger the proper events on
FOTreeBuilder so that new TableCell objects are ‘automatically’ created.
I haven’t had the opportunity to look into it into more details, but I’d
rather explore this possibility, instead of dealing with EmptyGridUnit.
If FO tree specialists have any comments or suggestions...


Thanks,
Vincent

Reply via email to