Bug 123971 - Row height incorrect in Calc on reload regression when row contains multiline text and cells with different font sizes
Summary: Row height incorrect in Calc on reload regression when row contains multiline...
Status: VERIFIED 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: Thorsten Behrens (CIB)
URL:
Whiteboard: target:7.0.0 target:6.4.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2019-03-09 21:19 UTC by jasonkres
Modified: 2020-05-10 18:55 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sheet to reproduce problem (9.52 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-03-09 21:20 UTC, jasonkres
Details
Screenshots of problem (22.66 KB, image/png)
2019-03-09 21:21 UTC, jasonkres
Details
Worse in Linux (33.13 KB, image/jpeg)
2019-11-05 12:04 UTC, themightyloki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jasonkres 2019-03-09 21:19:46 UTC
Description:
I am seeing a regression involving the height of spreadsheet rows that contain multiline text when different cells have different font sizes. I was using 6.0.4.2 and upgraded to 6.2.1.2. After doing this, my sheets are affected by a problem illustrated by the following repro.

I have had to workaround this by avoiding multiple font sizes in the same row. An alternative of overriding the heights after the text is entered is not feasible for my use case.

Steps to Reproduce:
1. Open the attached spreadsheet. It is a new sheet created in 6.2.1.2. The only interesting thing is that cells C1, C2, C3 are 12 pt font while all other cells are the default font size. The fact that two cells are gray is immaterial to the repro.
2. Put the 3 lines of text between these two bars on the clipboard in Plain Text format:
=====
Test
123 Any Street
New York, NY 12345
=====
3. Repeat these steps for cells B1, B2, B4, B5. (LEAVE EMPTY cells B3, B6.)
    3a. Double-click the indicated cell.
    3b. Press Ctrl+V to paste.
    3c. Press Enter to complete the edit.
4. Press Ctrl+S to Save.
5. Click File > Reload (or close and re-open the file).

NOTE: If you do not leave B3, B6 empty but paste the text in all of B1 through B6, the problem does not reproduce.

Actual Results:
Rows 1 and 2 are not the intended height. Rows 4 and 5 are correct.

Expected Results:
Rows 1, 2, 4, and 5 should be the same height, and there should be no vertical truncation of the multiline text.
The heights should be the same at the time of save and when the file is reloaded.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 6.2.1.2 (x64)
Build ID: 7bcb35dc3024a62dea0caee87020152d1ee96e71
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL
Comment 1 jasonkres 2019-03-09 21:20:40 UTC
Created attachment 149848 [details]
Sheet to reproduce problem
Comment 2 jasonkres 2019-03-09 21:21:11 UTC
Created attachment 149849 [details]
Screenshots of problem
Comment 3 m.a.riosv 2019-03-10 11:08:46 UTC
Repro
Version: 6.2.1.2 (x64)
Build ID: 7bcb35dc3024a62dea0caee87020152d1ee96e71
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US
Calc: threaded
Comment 4 m.a.riosv 2019-03-10 11:10:05 UTC
Also repro with
Version: 6.3.0.0.alpha0+ (x64)
Build ID: 9c5dbbe4b0a62ff1af009beb00f1fc45318dad79
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-02-27_20:03:12
Locale: es-ES (es_ES); UI-Language: en-US
Calc: CL
Comment 5 Oliver Brinzing 2019-03-10 11:28:14 UTC
reproducible with:

Version: 6.1.4.2 (x64)
Build-ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: 

but *not* reproducible with:

Version: 6.0.7.3 (x64)
Build-ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc:
Comment 6 Oliver Brinzing 2019-03-10 11:48:26 UTC
seems to have started with:

https://gerrit.libreoffice.org/plugins/gitiles/core/+/693953dd4699887bd3f5bca2c3582b5fae1d6992

commit	693953dd4699887bd3f5bca2c3582b5fae1d6992 [log]
author	Vasily Melenchuk <Vasily.Melenchuk@cib.de>Fri Apr 06 20:19:10 2018 +0300
committer Katarina Behrens <Katarina.Behrens@cib.de>Mon Oct 22 23:30:23 2018 +0200
tree	2091b2fe8d997ef84f149ace1e6a1f00fd8e08fe
parent	fad764c02c7a9cd210bfa44ea0ce1ac5354d6427 [diff]

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

/cygdrive/d/sources/bibisect/bibisect-win32-6.1
$ git bisect bad
40ab4a5cf85d27950e409bd4af0086cd98213719 is the first bad commit
commit 40ab4a5cf85d27950e409bd4af0086cd98213719
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Mon Oct 22 14:51:42 2018 -0700

    source sha:693953dd4699887bd3f5bca2c3582b5fae1d6992

    source sha:693953dd4699887bd3f5bca2c3582b5fae1d6992

:040000 040000 109429f0b4e7074293591b4bb614714854730480 80631ed7ef70e4de2eefa29d10c39c893f835b37 M      instdir

/cygdrive/d/sources/bibisect/bibisect-win32-6.1
$ git bisect log
# bad: [1d66cc00ca6fd2e562cbed88704051b2f5d989e3] source sha:8d2abb388b0a2423c9b7e1f52373e1b06dd9786f
# good: [29d08f54c2f71ffee4fe12dbb24c5f5cbedecfd2] source sha:6eeac3539ea4cac32d126c5e24141f262eb5a4d9
git bisect start 'master' 'oldest'
# good: [3ac46f6c41b5044f162a451b10af0dc5afdcc113] source sha:22c7c3f54dbb93f856190c561b2540064c5a767d
git bisect good 3ac46f6c41b5044f162a451b10af0dc5afdcc113
# good: [63fc3e0d41dd91f9fb3fe9891e009451285d9619] source sha:13a1bc409d9b2f0d14f4d316b7977b1fc2eb3c8a
git bisect good 63fc3e0d41dd91f9fb3fe9891e009451285d9619
# good: [6a75149c2bee2fa1c01b36aef4b734ceee7bc025] source sha:91d8af2c5cf4e8ec0f1ce0e532e0c896de77750b
git bisect good 6a75149c2bee2fa1c01b36aef4b734ceee7bc025
# good: [6440df548810a3adf5f7d125fe738467a5db7891] source sha:76c0b3c516f6b0d43136522b4d476eb60211cec1
git bisect good 6440df548810a3adf5f7d125fe738467a5db7891
# good: [809628c3decd16dacc705bda20efc603037667bf] source sha:3c20597ada7f74a4a96dec841264593fdbf0bcd5
git bisect good 809628c3decd16dacc705bda20efc603037667bf
# good: [0a5440cd08992f83f20aab2bcaa2b3e0be434d23] source sha:2c2ecb7eaa448f33162ce60154af207228ac05a8
git bisect good 0a5440cd08992f83f20aab2bcaa2b3e0be434d23
# good: [00b943e017c148697e3b4ab3c938edcb07e6a33a] source sha:e67ca59e293c4dd37795150cf871e36ca1affb76
git bisect good 00b943e017c148697e3b4ab3c938edcb07e6a33a
# bad: [521ff466935054556620576a8782a459686f955e] source sha:7a6e6d027ad41350ae1334d3e60dc1a6ce96c508
git bisect bad 521ff466935054556620576a8782a459686f955e
# bad: [07b7831aa81932b8a8cca5253d25a0d0157085b1] source sha:d860e6a138f08343b42f591462e85b85291b6fa8
git bisect bad 07b7831aa81932b8a8cca5253d25a0d0157085b1
# bad: [df5f87f82cc03697cc4d16b8700b35f667e6c948] source sha:5e582b7755c9d1e7e358cf5734c8b93d5219622d
git bisect bad df5f87f82cc03697cc4d16b8700b35f667e6c948
# bad: [15b060764ee7934c58786891fab4d0f38a09498e] source sha:5de85be43198804573787d4186b156b5931c4a9f
git bisect bad 15b060764ee7934c58786891fab4d0f38a09498e
# good: [180656b1b8aed5295a44cbacded98f37e45f5f1d] source sha:fad764c02c7a9cd210bfa44ea0ce1ac5354d6427
git bisect good 180656b1b8aed5295a44cbacded98f37e45f5f1d
# bad: [40ab4a5cf85d27950e409bd4af0086cd98213719] source sha:693953dd4699887bd3f5bca2c3582b5fae1d6992
git bisect bad 40ab4a5cf85d27950e409bd4af0086cd98213719
# first bad commit: [40ab4a5cf85d27950e409bd4af0086cd98213719] source sha:693953dd4699887bd3f5bca2c3582b5fae1d6992
Comment 7 themightyloki 2019-11-05 12:01:48 UTC
Reproducible and even worse in 

Version: 6.2.8.2
Build ID: 1:6.2.8~rc2-0ubuntu0.18.04.1
Threads CPU : 4; OS : Linux 5.3; UI Render : par défaut; VCL: gtk3; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded

I tried to create the proposed spreadsheet from scratch with this version. I had a very hard time getting the rows to adjust to the correct height. And after saving + loading, they do not display at the correct height

Furthermore, B1 and B2 show the little red triangle indicating truncated text, but cells B4 and B5 do not !
Comment 8 themightyloki 2019-11-05 12:04:05 UTC
Created attachment 155528 [details]
Worse in Linux
Comment 9 Thorsten Behrens (CIB) 2020-02-14 09:05:08 UTC
This is again just an earlier regression exposed by the "let's adjust row height on load" change from Vasily. Same problem happens before, when you multi-select all rows, and bonk on 'set optimal row height'. Commit causing this is:

     0a21fcb6ea9d1c46e8719e0920314ad4be316235 is the first bad commit
     commit 0a21fcb6ea9d1c46e8719e0920314ad4be316235
     Author: Jenkins Build User <tdf@pollux.tdf>
     Date:   Wed Sep 28 22:20:20 2016 +0200

         source sha:ef3ca1da6b6d994ea8c39f28a49a599f5cf67915

         source sha:ef3ca1da6b6d994ea8c39f28a49a599f5cf67915

      instdir/program/libsclo.so | Bin 20592212 -> 20592772 bytes
      instdir/program/versionrc  |   2 +-
      2 files changed, 1 insertion(+), 1 deletion(-)
Comment 10 Thorsten Behrens (CIB) 2020-02-14 09:06:20 UTC
commit ef3ca1da6b6d994ea8c39f28a49a599f5cf67915
Author: Markus Mohrhard <markus.mohrhard@googlemail.com>
Date:   Thu Aug 4 02:41:14 2016 +0200

    save about 50% of the import time for nearly empty ods documents
    
    It seems that currently most of the time is spent iterating through all
    the cells to get the optimal row height. We can easily optimize by using
    mdds::flat_segment_tree.
Comment 11 Commit Notification 2020-02-16 23:42:02 UTC
Thorsten Behrens committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f55140c7376c330bcdac071592aada75e8781e19

tdf#123971 don't clobber entire RowHeight range on updates

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2020-02-18 09:15:34 UTC
Thorsten Behrens committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/a915d7b7b9855a487902784dcdd8e295b6222519

tdf#123971 don't clobber entire RowHeight range on updates

It will be available in 6.4.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 BogdanB 2020-05-10 18:55:11 UTC
Solved. Verified on

Version: 7.0.0.0.alpha1
Build ID: 6a03b2a54143a9bc0c6d4c7f1...
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded