Bug 146668 - Height of cells with wrapped text is lost after saving, depending on the column width
Summary: Height of cells with wrapped text is lost after saving, depending on the colu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords: bibisected, bisected, regression
: 148139 148288 (view as bug list)
Depends on:
Blocks: Regressions-row-height
  Show dependency treegraph
 
Reported: 2022-01-09 16:27 UTC by Tobias Leupold
Modified: 2024-01-18 00:47 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Example with a column width of 18 cm before saving (31.53 KB, image/png)
2022-01-09 16:28 UTC, Tobias Leupold
Details
Example with a column width of 18 cm after saving, closing and re-opening (28.97 KB, image/png)
2022-01-09 16:29 UTC, Tobias Leupold
Details
Example with a column width of 17 cm before saving (30.68 KB, image/png)
2022-01-09 16:30 UTC, Tobias Leupold
Details
Example with a column width of 17 cm after saving, closing and re-opening (30.65 KB, image/png)
2022-01-09 16:30 UTC, Tobias Leupold
Details
The 18 cm column width saved file (7.85 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-01-09 16:31 UTC, Tobias Leupold
Details
The 17 cm column width saved file (7.77 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-01-09 16:31 UTC, Tobias Leupold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Leupold 2022-01-09 16:27:51 UTC
Description:
When declaring a cell as line-breaking, and the contained text is displayed in two lines, the height is (depending on the width of the respective column) lost after saving the file, closing it and re-opening it. After reopeing a file in such a case, the row's height is set to the default height, and the text (which is still line-breaking) is clipped.

Steps to Reproduce:
- Using the binary LibreOffice 7.1.7.2 package on Gentoo Linux, use Liberation Sans 10 pt (the default font setting)

- Type "aaaaaaa bbbbbbbbbbbbbbbb cccccccccccccccc dddddddddddd eeeeeeeeee fffffffffffff gggggg hhhhhhh iiiiiiiiiiiiiiiiiiiiiiii" in cell A1

- Set the width for column A to 18 cm

- Enable automatic line breaking for cell A1 (the text is displayed in two lines, the "iiiiiiiiiiiiiiiiiiiiiiii" appears in the second line)

- Save the file and close it

- Open the file

Actual Results:
Row 1's height is set to the default height, but the cell A1's text is still line-breaked. This leads to the text being clipped

Expected Results:
The height row 1 had when the file was saved should be preserved, no text should be clipped


Reproducible: Always


User Profile Reset: No



Additional Info:
Interestingly, this only happens for specific column widths:

If one sets the width of column A to 17 cm (instaead of 18), the visible result is the same, "iiiiiiiiiiiiiiiiiiiiiiii" is displayed in a second line.

But, in this case, after saving and re-opening the file, the height of row 1 is restored correctly, and no clipping happens.

See the screenshots I'll attach!
Comment 1 Tobias Leupold 2022-01-09 16:28:56 UTC
Created attachment 177415 [details]
Example with a column width of 18 cm before saving
Comment 2 Tobias Leupold 2022-01-09 16:29:31 UTC
Created attachment 177416 [details]
Example with a column width of 18 cm after saving, closing and re-opening
Comment 3 Tobias Leupold 2022-01-09 16:30:13 UTC
Created attachment 177417 [details]
Example with a column width of 17 cm before saving
Comment 4 Tobias Leupold 2022-01-09 16:30:51 UTC
Created attachment 177418 [details]
Example with a column width of 17 cm after saving, closing and re-opening
Comment 5 Tobias Leupold 2022-01-09 16:31:28 UTC
Created attachment 177419 [details]
The 18 cm column width saved file
Comment 6 Tobias Leupold 2022-01-09 16:31:53 UTC
Created attachment 177420 [details]
The 17 cm column width saved file
Comment 7 Tobias Leupold 2022-01-09 16:38:34 UTC
PS: Maybe this is still or again the problem from Bug #49255, but this one has been filed and fixed almost a decade ago. I just found it whilst researching the possible cause for this bug here.
Comment 8 LeroyG 2022-01-09 19:45:15 UTC
More:
- Open the 18 cm column width sample file (https://bugs.documentfoundation.org/attachment.cgi?id=177419)
- Paste "1111111 2222222 3333333 4444444 5555555 6666666 7777777 8888888 9999999 0000000 1111111 2222222 3333333" in A2
- Set Wrap Text
- Change the zoom level

Actual result:
The second 2222222 group changes from first to second line depending on zoom level. But, after reload, Wrap Text is not lost for this cell.

Version: 7.1.8.1 (x64) / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: es-MX (es_ES); UI: en-US
Calc: CL

Skia is not enabled.
Comment 9 LeroyG 2022-01-09 19:48:02 UTC
Maybe the title must be changed. A line break in a cell is set with Ctrl+Enter (not the case here). Wrap Text is the issue here.
Comment 10 Tobias Leupold 2022-01-09 20:09:54 UTC
This is actually right ;-)
Comment 11 Timur 2022-01-14 11:29:30 UTC
Wrong or correct cell height with wrap can be seen already on fileopen.
No repro 6.1 oldest, repro 6.1 master and 7.4+. Seems regression. 

commit ee9a64227e53eb0788cae2de947a41d0b3185b92
Date:   Tue Oct 23 00:07:51 2018 +0200
    source 693953dd4699887bd3f5bca2c3582b5fae1d6992
    pre fad764c02c7a9cd210bfa44ea0ce1ac5354d6427

author	Vasily Melenchuk <Vasily.Melenchuk@cib.de>	2018-04-06 
commit 693953dd4699887bd3f5bca2c3582b5fae1d6992 (patch)
tdf#62268: allow row height recalculation on document load
During document load rows with style:use-optimal-row-height="true"
should recalculate it's height.
 * includes: Row height tolerance level increase for unittest
 * tdf#118086: calc: invalid row autoheight fixed

Could be a duplicated of bug 130383 or bug 132354 but let's keep like this, because all is clear.
Comment 12 Stéphane Guillou (stragu) 2023-06-14 20:16:48 UTC
*** Bug 148139 has been marked as a duplicate of this bug. ***
Comment 13 Stéphane Guillou (stragu) 2023-06-14 20:21:46 UTC
CCing Vasily.
Comment 14 Stéphane Guillou (stragu) 2023-06-14 20:25:36 UTC
*** Bug 148288 has been marked as a duplicate of this bug. ***
Comment 15 Gabor Kelemen (allotropia) 2024-01-17 14:41:57 UTC
I can't reproduce this since 7.6 commit:

https://git.libreoffice.org/core/+/b1393fd5ce847f40abab49f57c67929bb0087fae

author	Maxim Monastirsky <momonasmon@gmail.com>	Fri Mar 17 14:54:30 2023 +0200
committer	Maxim Monastirsky <momonasmon@gmail.com>	Thu Mar 23 08:54:06 2023 +0000

sc drawstyles: ODF import and export
Comment 16 Gabor Kelemen (allotropia) 2024-01-17 15:38:57 UTC
Examples in bug 148139 also seem to work now.
The example in bug 148288 is looking better, but not perfect, since it's zoomed to 120%. Changing the zoom level to 100% however fixes it, and changing zoom also changes whether all text is visible or not - but this was also true in 6.1, so a different issue.