On Jan 26, 3:30 pm, Pierre <
deh...@drever.be> wrote:
> According to the documentation:
> | If you wish to set the format without changing the height you can
> pass undef as the height parameter:
> | $worksheet->set_row(0, undef, $format);
Hi,
First off, apologies for not replying sooner. Your question was stuck
in the moderation queue and for some reason I didn't get a
notification.
Anyway, the behaviour you are seeing is correct even if it seems
strange. In your first write() you say this:
> # Here the line height is correctly set to view the text
This happens because Excel sees that the row defaults haven't been
modified but that the text is larger than the cell so it adjusts the
height. However, this is not defined behaviour and there is no
guarantee that it will always do this. Also, other applications such
as LibreOffice or OpenOffice don't do any automatic adjustment of the
height.
In addition, once you modify the row in any way, such as adding a
format, then Excel will no longer automatically scale the cell height.
This is what you are seeing in the second case:
> # Now the line height is reset to its default value
In general you shouldn't rely on the automatic scaling and instead use
an explicit row height if you need one.
Regards,
John.
--