Bug 131073 - Optimal row height does not ignore hidden columns (i.e. counts with invisible cells, too)
Summary: Optimal row height does not ignore hidden columns (i.e. counts with invisible...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.5.0 target:7.4.3
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-02 14:59 UTC by thatho
Modified: 2022-10-04 13:00 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
testcase (10.89 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-03-02 15:01 UTC, thatho
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thatho 2020-03-02 14:59:19 UTC
Description:
Optimal row height does not ignore hidden columns and the optimal row height counts with the height of the invisible (not shown) cells.

Steps to Reproduce:
1. Enter some (random) text into a couple of cells (e.g. A1, A2, A3).
2. Set "wrap text" to all of the cells (cell height shall be adjusted automatically).
3. Hide the column with the most text in it.
4. Set optimal row height (with default paramneters).

Actual Results:
The row height does not change and empty space is left in other cells.

Expected Results:
The row height should be adjusted and ignore hidden columns.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.1.2 (x64)
Build ID: 4d224e95b98b138af42a64d84056446d09082932
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: cs-CZ (cs_CZ); UI-Language: en-US
Calc: threaded
Comment 1 thatho 2020-03-02 15:01:18 UTC
Created attachment 158312 [details]
testcase
Comment 2 m.a.riosv 2020-03-03 22:41:36 UTC Comment hidden (off-topic)
Comment 3 thatho 2020-03-03 22:55:15 UTC Comment hidden (off-topic)
Comment 4 m.a.riosv 2020-03-04 00:25:02 UTC Comment hidden (off-topic)
Comment 5 thatho 2020-03-04 11:00:33 UTC Comment hidden (off-topic)
Comment 6 Buovjaga 2020-05-10 19:45:58 UTC
Then let us submit to the will of the User Experience gods
Comment 7 Heiko Tietze 2020-05-11 09:22:57 UTC
Using single numbers in A1:A5 and Hello+\n+World (line wrapping with ctrl+enter) in A3. Optimal height from context menu using 0cm makes all rows as short as possible. (Issue that hidden rows are shown when applying the optimal height function ignored here.)

Please explain your workflow a bit more in detail.
Comment 8 thatho 2020-05-28 08:36:44 UTC
Explanation of the workflow: Handling data tables, applying user friendly formatting and preparing them for printing or export. That includes removing as much empty space as possible. The issue appears when a column with large texts in cells is hidden and empty space shall be reduced. Applying

4. Set optimal row height (with default parameters).

does adjust the row height to the largest element in the row even that element / cell content is hidden.
Comment 9 thatho 2020-05-28 08:48:11 UTC
Specifically to Comment 7 https://bugs.documentfoundation.org/show_bug.cgi?id=131073#c7

Imaging you have multiple of such rows. Hide the 3rd column, apply optimal row height (nothing notable happens), and show it to my boss *exaggeration*. He requests: Reduce the empty space in the cells so we cut the number of print pages to half. So, I do it by pulling up the row divider up one by one. Or setting the row height fixed (e.g. 4,52 mm as it is default). It is more handwork, when the data table is filled with text of different lengths/line break/rows.

Another workaround: deleting the columns instead of hiding. Applying optimal row height, exporting or printing and undoing the edits or closing without Save-confirm.
Comment 10 Heiko Tietze 2020-05-28 09:58:03 UTC
True, hidden cols/rows become expanded with optimal width/height. Expected behavior: the size is adjusted to the optimum but the row/cell remains hidden. 

Easy hack, Eike?
Comment 11 thatho 2020-07-06 20:55:41 UTC
I confirm the issue with

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 7dc3a20cab712ee987ea25a8f5728529521485b7
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL: win
Locale: cs-CZ (cs_CZ); UI: en-US
Calc: CL
Comment 12 QA Administrators 2022-07-08 03:36:42 UTC Comment hidden (noise)
Comment 13 Commit Notification 2022-09-12 08:26:36 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9caf9f8fde68f075a9ae1377bcc0cf6127c1737f

tdf#131073 - Don't show hidden rows/cols after setting optimal row/col height

It will be available in 7.5.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 14 Commit Notification 2022-10-03 15:18:10 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/38034728339c358286aa4fb97d372210712a9ad9

tdf#131073 - Don't show hidden rows/cols after setting optimal row/col height

It will be available in 7.4.3.

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 15 Timur 2022-10-04 08:05:04 UTC
I don't see this fixed as requested, please explain.
Comment 16 Andreas Heinisch 2022-10-04 08:11:13 UTC
Could you please provide a test case or detailed steps in order to check the problem again?
Comment 17 Xisco Faulí 2022-10-04 09:07:41 UTC
(In reply to Timur from comment #15)
> I don't see this fixed as requested, please explain.

Hi Timur,
Could you please also share the info from Help - About LibreOffice ?
Comment 18 Timur 2022-10-04 09:19:29 UTC
I followed Description. 
Open attachment 158312 [details] and see that B column is hidden.
Mark row 1 and do Optimal height. 

Actual Results:
The row 1 height does not change.

Expected Results:
The row 1 height should be adjusted to C, not B. 

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: a0bc0cc81b597aa81189355a8125753d6b873cce
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 19 Eike Rathke 2022-10-04 10:24:23 UTC
Apparently the request is to ignore hidden columns when calculating the optimal row height. I'm not convinced this even is a good idea. Hiding columns is hiding them from the current *view*, not from calculations or other processing.

If the request was implemented then we'd end up with different then fixed row heights depending on which column was hidden at the moment of calculation. IMHO not a good state.
Comment 20 Andreas Heinisch 2022-10-04 12:09:01 UTC
From the user perspective, I would expect it to change using also the hidden cols/rows, otherwise, you have to change the optimal height/width again if you show some additional cols/rows.