[reportlab-users] Another tables patch

Gary Poster gary at zope.com
Thu Mar 17 05:56:37 EST 2005

Hello.  Please find attached an additional patch.  This one is against 
the SVN trunk, revision 2539 (current as of this writing).  It is 
intended to be applied by cd-ing into the platypus directory and then 
the usual "patch -p0 <platypuspatch".  As you can see, it mainly 
patches tables.py, but has a small change to paragraph.py.

This patch does three things.

First, the patch I sent yesterday included one diff that didn't make it 
to the checkin yesterday: without it, the join code breaks.  Without 
the changes, the code also barely avoids stomping on the following 
arguments, if provided, such as linecount.  Today's patch reinstates 
the fixes.  The change is the last one listed in the tables.py portion 
of the patch.  (I'm not even sure if specifying a join in a table 
actually has a visible effect because of the way the lines are drawn, 
but the code is there so it might as well be correct.)

Second, today's patch includes code to make a much better guess about 
column widths in the case of a table with both non-fixed-width 
flowables, such as paragraphs, and columns without absolute widths 
specified (None or '*'; maybe code should also check for percentages).  
It respects percentage requests as much as possible while doing its 
best to give columns the minimum width they need.  Widths of '*', if 
present, are considered greedy in comparison to widths of None.  
Another part of the change is that if the total table width is greater 
than the available space it no longer raises an error: I think this is 
an improvement, but I could be mistaken.  In total, this part of the 
patch a very nice improvement and works well in my code.  It exercises 
the Flowable.minWidth method to a greater degree than before, so it 
might expose some problems in other flowables...which leads to the last 

Third, the patch includes simple code for paragraphs.py that handles 
the edge case of minWidth for a paragraph with no content.

I hope you can use the patch.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: platypuspatch
Type: application/octet-stream
Size: 8965 bytes
Desc: not available
Url : http://two.pairlist.net/pipermail/reportlab-users/attachments/20050317/3b6db4cd/platypuspatch.obj

More information about the reportlab-users mailing list