Strange column widths in report with repeated columns

Let’s take a simple ods report template with repeated columns:
screenshot1
Result of generating this report:


Why is the width of columns A, B, C, D in the result equal to the width of column B in the template?
Why is the width of column E in the result equal to the width of column D in the template?
We believe that the width of column A should not have changed, and the width of columns B, C, D, E in the result should be equal to the width of column C in the template.

I guess it is because there are two cell loops on two different rows.
I guess the _handle_column_loops is generating too much directives on the table-column tag.
I think you should report a bug with a simple example that allows to reproduce easily the problem.

We have removed the first loop and got the same result.

Template:
screenshot3

Result:

We have prepared a patch that fixes this bug:
https://relatorio.tryton.org/bug57

Here is a document generated from the first template after fixing:
screenshot5

This patch also fixes the following bug:
Report with repeated columns and spanned cells in heading

Request for developers: please check the patch and update relatorio if everything is OK.

Merry Christmas and Happy New Year!