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

Robin Becker robin at reportlab.com
Mon May 30 05:27:14 EDT 2022


I think the problem is the use of these lines in the patched tables.py

1952: T._linecmds = T._splitLineCmds(n, doInRowSplit=doInRowSplit)
1954: R0._cr_0(n,T._linecmds,nrows)
1989: R1._cr_1_1(n,nrows,repeatRows,T._linecmds)
2005: R1._cr_1_0(n,T._linecmds)

I changed to

1952: _linecmds = _splitLineCmds(n, doInRowSplit=doInRowSplit)
1954: R0._cr_0(n,_linecmds,nrows)
1989: R1._cr_1_1(n,nrows,repeatRows,_linecmds)
2005: R1._cr_1_0(n,_linecmds)


and that seems to fix the problem for the simple split test with back communication modifying the original table. The 
split offspring tables s0 s1 also seem to draw the same lines as unpatched after I change those lines.

I think the unpatched tables.py had a variable A for the _linecmds.

I would be glad if you can check if my change is valid.

On 30/05/2022 09:05, Robin Becker wrote:
> On 29/05/2022 10:58, Robin Becker wrote:
>> Hi Lennart,
>>
>> I did the obvious monkey patch to the Table class and can now see that the splitInRow case table split method is 
>> modifying something in the original table.
>>
>> The two split offspring don't seem to show any differences between the standard and patched case.
>>
>> .......
> ..........
> 
> Hi Lennart, I did some more investigation and find that the _linecmds of the table that is split are changed by the 
> split method.
> 
> unpatched case
> 
> before split
> ('GRID', (0, 0), (-1, -1), 0.5, Color(.501961,.501961,.501961,1), 1, None, 1, 1, 0.5)
.........


-- 
Robin Becker


More information about the reportlab-users mailing list