Hi Vincent,

> Looks like you pinpointed the problem, well done. I’ve just submitted
> a fix, please test with your real-life file.
> http://svn.apache.org/viewvc?rev=1083863&view=rev

Thanks for committing the fix!

> On 19/03/11 21:22, Matthias Reischenbacher wrote:
>> Hi Andreas,
>> thanks a lot for your explanation of how keep conditions are enforced!
>> Today I had been looking at the same code as you and I found it odd that
>> the
>> table keep condition is only taken into account inside
>> TableStepper.getCombinedKnuthElementsForRowGroup() if the rowFinished
>> value
>> is set to false. Do you have any idea what rowFinished means in this
>> context? When debugging the code with my test case the value of
>> rowFinished
>> is always true and therefore the if statement seems to be dead code.
> This means that the end of a table-row has been reached. That is, all
> the content of all the cell ending on that row has been handled. If you
> are talking about the test case you posted on the users list, then you
> always get true because all your cells are one line, so the end is
> immediately reached. Try again with cells containing several blocks of
> text.

Ah ok, now I understand.

>> Do you think it would be a solution to just move out lines 250 and 252 of
>> the if statement and execute it always.
> Yes indeed, this is what I did.

Why you didn't move out:
keep = keep.compare(rowGroup[activeRowIndex].getKeepTogether());
If i remove the keep attribute from the table and add it on the table row
the keep doesn't work anymore.

> In theory it would be better to handle table keeps in a table-related
> class (TableLM or TableContentLM), but it is impractical to modify the
> list of Knuth elements afterwards.
>> Perhaps then the additional keep
>> condition handling inside TableContentLM.getKnuthElementsForRowIterator()
>> could be removed?
> No, it’s needed to handle keeps between row groups. Loosely speaking
> a row group is the smallest set of table rows that are spanned by cells.
> Usually a row group is the same as a row, but it may become more
> complicated when cells span several rows. For example:
>     __________________________________
>     |          |          |          |
>     |          |__________|__________|
>     |          |          |          |
>     |__________|__________|          |
>     |          |          |          |
>     |__________|__________|__________|
>> Thanks & Regards,
>> Matthias
> Thanks for investigating this.
> Vincent

Thanks also to Andreas!


View this message in context: 
Sent from the FOP - Dev mailing list archive at Nabble.com.

Reply via email to