On Sat, Sep 29, 2007 at 08:59:36AM +0200, Andreas L Delmelle wrote: > As far as I can tell for the moment, the error is virtually always the same > ClassCastException, since the related LMs expect a list of KnuthElements, > where they currently get a list of ListElements. > A KnuthElement is always a ListElement, but not vice versa. The newly added > ParagraphListElement, for instance, is not a KnuthElement. This seems to be > causing the CCE's.
Indeed, that is to be expected. Linebreaking for these paragraphs has not yet been done. The essence of this branch is that linebreaking is postponed until the pagebreaker needs to know the lines. For the page elements---let me call this block mode, after TeX, which calls this vertical mode---linebreaking during pagebreaking has been implemented. See PageBreakingAlgorithm.resolveElements(KnuthSequence, int) and its caller BreakingAlgorithm.findBreakingPoints. For restricted block mode, named so after TeX's restricted vertical mode, linebreaking is just not yet done. Finding out how to do that properly when the pagebreaker requires the results, is the task that remains. It applies a.o. to footnotes, list labels, table cells. > Either the code in ListItemLM and others needs to be adapted to deal with > ListElements instead of KnuthElements, or the ParagraphListElement needs to > subclass KnuthElement instead of ListElement directly. ParagraphListElements are not supposed be KnuthElements. The error is genuine. After linebreaking has been applied to ParagraphListElements, they have been replaced by KnuthBlockBoxes and similar KnuthElements. Then the CCE will have been removed. Regards, Simon -- Simon Pepping home page: http://www.leverkruid.eu