Re: Patch to support tables with oversize cells
Robin Becker <[email protected]> Mon, 30 May 2022 14:01:52 +0100
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <[email protected]> |
On 30/05/2022 13:16, Lennart Regebro wrote: > On Mon, May 30, 2022 at 11:27 AM Robin Becker <[email protected]> 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