Download it now!
Bug 129985 - FILESAVE XLSX Default Excel date format saved incorrectly
Summary: FILESAVE XLSX Default Excel date format saved incorrectly
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.0.0 target:6.4.3
Keywords: bibisected, bisected, filter:xlsx, regression
Depends on:
Blocks:
 
Reported: 2020-01-13 15:02 UTC by NISZ LibreOffice Team
Modified: 2020-03-16 17:15 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel (14.77 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-01-13 15:04 UTC, NISZ LibreOffice Team
Details
The original file saved by Calc. (12.49 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-01-13 15:05 UTC, NISZ LibreOffice Team
Details
Screenshot of the original document side by side in Excel. (72.13 KB, image/png)
2020-01-13 15:05 UTC, NISZ LibreOffice Team
Details
Screenshot of the exported document in Excel (70.96 KB, image/png)
2020-01-13 15:07 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-01-13 15:02:59 UTC
Description:
Attached simple XLSX file contains date formatted cells with the default locale-dependent Excel format in A2:A3.
After saving the file in Calc the date format changes to Custom “[$-409]h.n.éééé” ([$-409]m.d.yyyy in Excel 2013 using English locale and [$-40E]éééé.hh.nn ([$-40E]yyyy.mm.dd) using Hungarian locale.

Steps to Reproduce:
1. Open attached file in Calc and save it as XLSX.

Actual Results:
Excel does not recognize the cell format as Date, instead it lists it under Custom.

Expected Results:
Excel recognizes the cell format as Date – Locale-dependent default.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 NISZ LibreOffice Team 2020-01-13 15:04:33 UTC
Created attachment 157123 [details]
Example file from Excel
Comment 2 NISZ LibreOffice Team 2020-01-13 15:05:02 UTC
Created attachment 157124 [details]
The original file saved by Calc.
Comment 3 NISZ LibreOffice Team 2020-01-13 15:05:33 UTC
Created attachment 157125 [details]
Screenshot of the original document side by side in Excel.
Comment 4 NISZ LibreOffice Team 2020-01-13 15:07:33 UTC
Created attachment 157126 [details]
Screenshot of the exported document in Excel
Comment 5 NISZ LibreOffice Team 2020-01-13 15:16:09 UTC
Comment on attachment 157123 [details]
Example file from Excel

Example file from Excel.
Comment 6 NISZ LibreOffice Team 2020-01-14 10:23:40 UTC
Bibisected using bibisect-win32-6.2 to: 

URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=d0f8daa0980ba8e403b32006831657c5a0a4ea17 

author	Eike Rathke <erack@redhat.com>	2018-08-22 13:16:19 +0200
committer	Eike Rathke <erack@redhat.com>	2018-08-22 19:03:27 +0200

Resolves: tdf#73063 preserve and roundtrip LCID from/to Excel number formats
Comment 7 Xisco Faulí 2020-01-20 17:53:58 UTC
Moving to NEW as it has been bisected
Comment 8 Xisco Faulí 2020-01-20 17:56:09 UTC
For the record, I can reproduce it in

Version: 6.5.0.0.alpha0+
Build ID: fc1f85127968d1c2e0a53dace51bf8a78f9e6ca5
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

and MSO Excel 2010

@Eike, would you mind taking a look ?
Comment 9 Eike Rathke 2020-03-15 16:14:44 UTC
This is an import failure that apparently always existed but had no consequences so far. Note that the date format here in LO becomes a fixed-locale format (e.g. English-US or Hungarian) and not a system locale format (e.g. Default English-US or Default Hungarian). Since the commit mentioned that is exported as such as it should.
Comment 10 Commit Notification 2020-03-15 18:33:32 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5b88a664b1ad2b5761a4672678845cc77be6cd4d

Resolves: tdf#129985 OOXML import: do not force a fixed-locale number format

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 11 Eike Rathke 2020-03-15 18:37:02 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/90399 for 6-4
Comment 12 Xisco Faulí 2020-03-16 15:45:37 UTC
Verified in

Version: 7.0.0.0.alpha0+
Build ID: 5a2c340e00050e21f29ae880593ef4f9ec1ba08d
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

@Eike, thanks for fixing this issue!!

Unittest created: https://gerrit.libreoffice.org/c/core/+/90573
Comment 13 Commit Notification 2020-03-16 15:47:55 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/95d35dd3109263a1708fab143accc0f45a05758d

Resolves: tdf#129985 OOXML import: do not force a fixed-locale number format

It will be available in 6.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 14 Commit Notification 2020-03-16 17:15:13 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2f7f34bf9fb744a2615426e4414dff3ca6fbe6e4

tdf#129985: Add unittest

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.