[reportlab-users] Patch to support tables with oversize cells

Robin Becker robin at reportlab.com
Mon May 30 09:01:52 EDT 2022


On 30/05/2022 13:16, Lennart Regebro wrote:
> On Mon, May 30, 2022 at 11:27 AM Robin Becker <robin at reportlab.com> wrote:
> 
>> I think the problem is the use of these lines in the patched tables.py
>>
>> 1952: T._linecmds = T._splitLineCmds(n, doInRowSplit=doInRowSplit)
>>
> 
> Yes, you are right, the original did not set that on the T table, but just
> used the A variable. I'm surprised this leaks back to the original table,
> but your change there is definitely good, setting it on the T table is not
> useful.
> 
> If you want to I can implement a 2-level copy if _cellvalues, _cellstyles
> etc as well, to ensure the original table is unchanged?
> 
> //Lennart
> 

I ran all my tests and see only the changes in tests related to the new pages.

So far as I can tell we only have to look for assignments to self._cellvalues etc etc in the splitrows method.

For whatever reason we have T is self in the non-splitInRow case so we have to be careful about assignments to T.attr in 
the code executed by that branch.

I think on the other branch we create a new T, but it's not clear that we are setting stuff back on self unless some 
mutable is shared and then modified.
-- 
Robin Becker


More information about the reportlab-users mailing list