Bug 159945 - (Regression since 7.6) Optimal-width columns too small (shows '#' chars)
Summary: (Regression since 7.6) Optimal-width columns too small (shows '#' chars)
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-02-28 17:34 UTC by Jim Avera
Modified: 2024-03-24 03:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Tdemo.ods -- spreadsheet showing the problem (93.89 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-02-28 17:35 UTC, Jim Avera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2024-02-28 17:34:34 UTC
Description:
Same symptoms as in https://bugs.documentfoundation.org/show_bug.cgi?id=99584 except the test case here works in 7.6.3.0, whereas bug 99584 was about similar-looking problems present all the way back to 4.2 .

I'm opening a separate bug because this seems to be a regression since 7.6.3.0 and before 24.2 (but is also present in 24.8 alpha).   Maybe a bisect could be useful?

This demo spreadsheet uses macros to populate cells and also conditional formats, which might (or not) be related to the current symptoms.



Steps to Reproduce:
1. Open the attached Tdemo.ods (please enable macros)
2. On the _PROTO sheet, click the red "Test" button

(this runs a macro which creates a new sheet "MSFT" and populates it with data)

3. In the MSFT sheet: Set magnification to 100% if needed
4. Resize columns for Optimal Width with 0.00 additional space
   (Select all columns; put cursor in a column header; 
    rightclick->Optimal Width..., set the Add to 0.00, click OK)

Actual Results:
Some cells display ###.

Note especially column E where the values shown as "###" are all constants, not numbers -- however E4, which is horizontally spanned and does not overflow, was set by a macro (details below).

Expected Results:
All data should fit in the optimized column widths


Reproducible: Always


User Profile Reset: No

Additional Info:
The horizontally-spanned cell E4 contains the string "TESTDATA sheet" which was put there in Basic macro code by executing

  NewSheet.getCellRangeByName("SourcePathCell").String = "TESTDATA sheet"

(where SourcePathCell is a Named Range equivalent to $E$4 -- which can be seen via Sheet->Named Ranges and Expressions->Manage)

-----
NOT REPRO in 7.6.3.0.0

REPRO in 24.2 and master:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3b73071f7a7fcf80547da81e5effe4ed6018bbb4
CPU threads: 12; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Jim Avera 2024-02-28 17:35:12 UTC
Created attachment 192850 [details]
Tdemo.ods -- spreadsheet showing the problem
Comment 2 m_a_riosv 2024-02-28 22:41:16 UTC
Macro fails for me in line:
262:     OptionExpDt = Left(Expiry,3) & " " & Mid(Expiry,4,2) & ", 20" & Mid(Expiry,7,2)
Error: Inadmissible value or data type.
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5234ef71c7459506236d4d0dfe7beb5f00d8cc41
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 3 Jim Avera 2024-02-28 23:10:00 UTC
>Macro fails for me in line:  262 ...

Hmm. Miguel, I'm wondering what might be different about your system or profile?  You are using Windows, so I tried  24.2.0 (the official release build) on a Windows 10 machine but did not get any errors, and the bug reproduced as before.   I also tried "safe mode" on Linux i.e. with a new profile, and still repro as before, with no macro errors.

Strange.
Comment 4 Stéphane Guillou (stragu) 2024-02-29 07:03:12 UTC
(In reply to m_a_riosv from comment #2)
> Macro fails for me in line:
> 262:

Same for me, "data type mismatch".

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5234ef71c7459506236d4d0dfe7beb5f00d8cc41
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 24.2.1.1 (X86_64) / LibreOffice Community
Build ID: 359ef544e625d2ffbfced462ab37bd593ca85fa7
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

MSFT sheet is still created, but only one row of data in the table. Using Optimal Width + 0 does not give me the ### issue.

Can you test again and maybe provide a new version of the file?
Comment 5 Jim Avera 2024-03-24 00:56:12 UTC
Is it possible we are running different versions of Java?   I assume LO comes with it's own internal Java interpreter; however I have several other Java interpreters installed to support other applications, so if LO were to accidentally use one of those, then behavior might be different.

Just an idea (shot in the dark).
Comment 6 QA Administrators 2024-03-24 03:15:03 UTC Comment hidden (obsolete)