[reportlab-users] question about keepWithNext and multibuild

Robin Becker robin at reportlab.com
Tue Sep 23 09:59:04 EDT 2008


adam hyde wrote:

> hi,

>

> I saw the bug mentioned last week or so (keepWithNext failing with

> multibuild).

>

> Someone from reportlab said they would look at it - did you manage to

> check it out? I'm not sure how to check if there bug has been fixed etc

> (so guessing this list is the best place to ask)

........

I had a look at this and think it will be pretty hard to fix this stuff up
easily. The original intent of the doctemplate class was to be a simple single
pass process. That meant that the requirement of non-mutable story contents was
not strictly observed.

For multi-pass there is an absolute requirement that the story contents not be
seriously modified during each pass. Of course things like the actual contents
of flowables may change so something that rendered as 'pass 0' might eventually
end up as rendering as 'pass 2', but the keepWithNext stuff is implemented by
injecting new things into the story and modifying the original styles.

Currently the multi-pass builder which was introduced by Andy to allow easier
calculation of references/tables of content etc etc makes little effort to clean
up undesired changes made during each pass. Probably we need to keep a list of
structural changes that are made and reverse these prior to succeeding passes.
The alternative is to find better implementations of keepWithNext and similar
which remain invariant after first usage.
--
Robin Becker


More information about the reportlab-users mailing list