Thanks a lot, Luca. That was it. I was slowly tracking that thing down. I knew already that these start indices were wrong but hadn't figured out how to fix it.
And thanks to Chris for the pointers earlier. In the meantime I got to know a lot about the inner workings of the line layout. :-) Good for the next time. On 02.02.2005 15:24:44 Luca Furini wrote: > > Jeremias Maerki wrote: > > > If someone has an idea about the ArrayOutOfBoundsException, all the > > better. I'm currently trying to debug that thing. > > It's because of this line in LineLM.addAreas(): > iCurrParIndex = 0; > If a block has properly handled preserved linefeeds, it will generate more > than one paragraph, so the ArrayList knuthParagraphs will have more than one > element. > In your test file, there will be: > (Paragraph #0) <!-- list level 1 --> > (Paragraph #1) <fo:list-block provisional-distance-between-starts="0.4cm" > (Paragraph #2) provisional-label-separation="0.15cm"> > (Paragraph #3) <!-- list item --> > > If the block is split between two pages, the method LineLM.addAreas will be > called twice: for example, there will be Paragraph #0 and #1 on page 1, and > the others on page 2. > The second time addAreas() is called iCurrParIndex is set to 0, and here is > the bug, because the index stored in the LineBreakPosition lbp refers to an > element in Paragraph #2! > > Maybe the best place to store the correct value is inside the > LineBreakPositions; I'm attaching a little patch which modifies the > LineBreakPosition class (and also removes an old, unused method). > > As per the ignored newline characters in the TextLM, I really can't remember > why I wrote those lines! :-) > It really looks like they shouldn't be ignored. > > HTH > Regards, > Luca > Jeremias Maerki