Thanks for solving bug 36248, total number of pages with empty block
:ClassCastException in KnuthInlineBox.

Unfortunately perhaps, I think I have a better idea for handling block
content in inline content, specifically in InlineLM. 

For each block Knuth element that InlineLM receives from a BlockLevel
child LM, it should insert a complete one-line paragraph into its
return list. This paragraph consists of a KnuthBox, a KnuthGlue with
infinite stretchability, and a negative infinite penalty.  In this way
InlineLM would hide the block content from the other LMs, which is
appropriate. This also solves the problem that getNextKnuthElements
does not really return the same type of object for BlockLevel and
InlineLevel LMs.

It allows us almost to go back to the old code in LineLM. The only
difference is that the return list may contain multiple paragraphs,
whose end is signalled by a negative infinite penalty. Even this is
not really necessary, but I think it is more efficient than returning
to LineLM at the end of each paragraph.

I have not investigated how InlineLM would do the conversion from
block elements to a paragraph and back, but I do not see a huge
problem there.

If no one else does it before me, I will try to work out this idea,
but not until several weeks from now.

Sorry for not thinking of this rather obvious solution earlier. It
would have saved some work.


Simon Pepping
home page:

Reply via email to