(see Harald Armin Massa's posting to the RL mailing list):
on updating some projekt to RL 2.2; and wordaxe 0.3.0, I ran into some
obscure wrapping / splitting bug.
As it turned out:
the SplitRoutine within NewParagraph get's problems when doc.multibuild is
used.
I tracked it down to:
if not hasattr(self, "_lines"):
# This can only happen when split has been called
# without a previous wrap for this Paragraph.
# From looking at doctemplate.py and frames.py,
# I assume this is only the case if the free space
# in the frame is not even enough for getSpaceBefore.
# Thus we can safely return []
#~ print "split without previous wrap"
return []
NewParagraph of Wordaxe relying on self._lines NOT being present when
there was no "wrap" in the actual build pass, to return "I cannot
split"
BUT...
in a multibuild, in the second build pass that self._lines is present
from the first build pass ... , and _unused is an empty list (as some
wraps from the build pass before have used up everything)
So MY fix was in doctemplate multibuild:
#clean up so multi-build does not go wrong - the frame
#packer might have tacked an attribute onto some flowables
for elem in story:
if hasattr(elem, '_postponed'):
del elem._postponed
if hasattr(elem, '_lines'):
del elem._lines
to extend the "cleanup" part to also delete the _lines attribute of a
NewParagraph; together with the _postponed attribut.
So everything works fine ... but I am not sure if this is really the
best approach, and the NewParagraph split/wrap is quite to challenging
to really be sure.
That's why I am posting this fix for others to enjoy and for more
enlightened ones to check:)
Harald
Nobody/Anonymous
None
None
Public
|
Date: 2009-02-12 20:15 The bug is fixed in the trunk. |
|
Date: 2009-02-09 20:30 It should be possible to rename the test directory with "svn mv test |
|
Date: 2009-02-09 12:08 Yes, the test suite is weird. The test/tests problem is due to me being a |
|
Date: 2009-02-09 00:22 Just tried to run the test suite, but I cannot get it running even with a |
|
Date: 2009-02-08 21:31 Now I tried your patch. |
|
Date: 2009-02-08 20:57 Your patch works for me. It's essentially the same as Harald's, but you |
|
Date: 2009-02-08 18:17 I just tried another way to get rid of this bug which does not require to |
|
Date: 2009-02-08 16:58 My patch in the last comment was insufficient and SF removed the |
|
Date: 2009-02-07 17:12 I stumbled over the same problem today when creating a document with a |
|
Date: 2009-02-04 19:28 Today RL 2.3 was released. I'll try and build a wordaxe version for RL 2.3 |
|
Date: 2008-12-21 11:41 Robin Becker posted on the ReportLab users list that at least in the RL |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use