Bug 145911 - Optimal Width incorrectly assesses cells where wrapping is active (see comment 2)
Summary: Optimal Width incorrectly assesses cells where wrapping is active (see commen...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 155172 (view as bug list)
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2021-11-27 13:48 UTC by Colin
Modified: 2023-05-11 16:12 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example (14.95 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-11-27 13:49 UTC, Colin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Colin 2021-11-27 13:48:07 UTC
Description:
Cells that have been created with the functions TEXT & TEXTJOIN are not correctly assessed when column > optimal width is invoked from the context menu.
The assessment is affected by the contents of "informal header" cells.
Attached sheet with highlighted cells demonstrates the effect.

Steps to Reproduce:
Note Word Wrap is active for the entire sheet as is Centred Text
Utilising the attached sheet select columns to include D
1. Right click the header and select optimal width
2. Observe how the column shrinks to facilitate the single character in D2
3. Undo the action
4. Delete "D" from D2
5. Redo 1
6. Observe how the column expands to over-compensate for the cell content
7. Undo
8. Enter text into D2 that is "almost" as lengthy as the contents of D3:D4
9. Redo 1
Columns y & Z demonstrate the same anomaly whereas AF seems to be on its own planet as it shrinks the column to the contents of AF3:AF4 leaving AF2 in an overflow condition
10. Undo
II. Change Global Alignment to Left Justified
12. Select columns B:G
13. Redo 1
14. Observe
Note that Column A is a simple assignment of Column D and is processed correctly
Observation: Wordwrap has the same effect as Left Justified

Actual Results:
Inconsistent and incorrect column width adjustment

Expected Results:
Consistency would be good - accuracy aven better


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: sv-SE (en_GB); UI: en-GB
Calc: threaded
Comment 1 Colin 2021-11-27 13:49:20 UTC
Created attachment 176534 [details]
Example
Comment 2 geoff183 2022-08-26 22:30:33 UTC
It seems that word wrap is all that's needed to show this problem.
1 In New sheet,enter "X" in a cell
3 Optimal width (or double click the right border in the column header)
4 Cell shrinks down to correct width
5 Activate word wrap for that cell
6 Optimal width
7 Cell expands
Comment 3 Buovjaga 2023-01-30 10:45:54 UTC
(In reply to geoff183 from comment #2)
> It seems that word wrap is all that's needed to show this problem.
> 1 In New sheet,enter "X" in a cell
> 3 Optimal width (or double click the right border in the column header)
> 4 Cell shrinks down to correct width
> 5 Activate word wrap for that cell
> 6 Optimal width
> 7 Cell expands

Already in 6.3 and 3.5

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d33dbd8d3bee4dfd614ae0153ebca3db3948e9f8
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 30 January 2023
Comment 4 Stéphane Guillou (stragu) 2023-05-11 16:08:07 UTC
*** Bug 155172 has been marked as a duplicate of this bug. ***
Comment 5 Stéphane Guillou (stragu) 2023-05-11 16:12:04 UTC
Was also in OOo 3.3, so marking as inherited.
Very much related to bug 57150, likely a duplicate.