What the hell is unfortunate about having a better idea? If that helps make the code simpler and more easily understandable that's cool. And it sounds like it does. I simply had to fix the problem somehow because I want to get the first release out as soon as possible. And I was very happy that you already provided me with something to start with (that doesn't happen for the first time. Hey Luca!). It doesn't have to be (and can't be) perfect in this short time. So I'm perfectly happy if you look at this again when you have time.
On 21.08.2005 20:58:36 Simon Pepping wrote: > 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. Jeremias Maerki