https://issues.apache.org/bugzilla/show_bug.cgi?id=37579





--- Comment #44 from Andreas L. Delmelle <[EMAIL PROTECTED]>  2008-05-17 
16:19:07 PST ---
(In reply to comment #38)
> (In reply to comment #37)

> > - from a high-level point of view first: list- and table-related code should
> > remain totally footnote-agnostic. The footnote-handling code should remain 
> > in a
> > single class and not be spread over the codebase, which would make it
> > error-prone and difficult to maintain and understand.
> 
<snip />
> I'm wondering how can this be done without making either of them
> footnote-aware... 

Been doing some more thinking, and what if we were to introduce something like
a 'FootnoteCollector'? I think something like this would also address Adrian's
concern about a complete solution...
Right now, the LineLayoutManager separates the footnotes from their citations,
and attaches them as a  member-list to the KnuthBlockBoxes. The same approach
is now copied to list- and table-layout: extraction of the footnotes from the
boxes, and copying them to higher-level block-boxes.

What if we pass a FootnoteCollector down from the PageBreaker, which contains a
Map<KnuthBox, List<FootnoteBodyLM>>, or maybe simply Map<KnuthBox,
FootnoteBodyLM[]>.

The LineLayoutManager would do something like:

footnoteCollector.collect( KnuthBox, List<KnuthBox> );

which would use the box as a key, and put the resulting list as a value in the
map.

Something similar would be done by the list- and table-related LMs.

The iterations that are now spread over LineLM, PageBreaker, ActiveCell,
TableStepper and ListItemLM can then be confined to one single class.

PageBreaker could do something like:

footnoteCollector.getFootnotesFor( List<KnuthBox> )

to obtain a combined list of footnotes for all the boxes in the list.

WDYT?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to