Bug 152053

Summary: Calc opens CSV with narrow column so cannot read the date
Product: LibreOffice Reporter: Jonny Grant <jg>
Component: CalcAssignee: Eike Rathke <erack>
Status: VERIFIED FIXED    
Severity: normal    
Priority: medium    
Version: 5.3 all versions   
Hardware: All   
OS: All   
Whiteboard: target:7.5.0 target:7.4.4
Crash report or crash signature: Regression By:
Attachments: calc.csv example
Screenshot showing the issue when opening the CSV file

Description Jonny Grant 2022-11-15 13:36:43 UTC
Calc opens CSV with narrow column so cannot read the date. Users need to manually resize the Date column.
the fields are correctly detected as dates, Calc should set appropriate column width
Comment 1 Jonny Grant 2022-11-15 13:37:12 UTC
Created attachment 183607 [details]
calc.csv example
Comment 2 Jonny Grant 2022-11-15 13:37:36 UTC
Created attachment 183608 [details]
Screenshot showing the issue when opening the CSV file
Comment 3 Eike Rathke 2022-11-15 17:00:10 UTC
Note that whether that string 29/12/20 is recognized as date is locale dependent, in a locale where it is not recognized as date it is imported as text and the cell width is correctly adjusted. Use 2020-12-29 instead.
Comment 4 Commit Notification 2022-11-15 18:56:23 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8309f94001ec29faff288cb8f920ee00978bb85a

Resolves: tdf#152053 GetOptimalColWidth() obtain number format from next row

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 5 Eike Rathke 2022-11-15 18:58:52 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/142687 for 7-4
Comment 6 Jonny Grant 2022-11-15 21:05:59 UTC
Amazing Eike!
Comment 7 Commit Notification 2022-11-17 16:22:30 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/6fb437e6cef4ca402e81ee8037f361a4de911549

Resolves: tdf#152053 GetOptimalColWidth() obtain number format from next row

It will be available in 7.4.4.

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 8 Stéphane Guillou (stragu) 2022-11-18 16:48:35 UTC Comment hidden (obsolete)
Comment 9 Stéphane Guillou (stragu) 2022-11-18 16:49:28 UTC
(Sorry for the misspelling!)

Thanks Eike, verified as fixed in:

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 45d1fca81991f0d6837c98d6be6fe0d21d566fa5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 10 Commit Notification 2022-11-21 13:09:09 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#152053: sc_subsequent_filters_test2: Add unittest

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.