Bug 128649 - FILESAVE: XLSX: Calc save to xlsx flawed
Summary: FILESAVE: XLSX: Calc save to xlsx flawed
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:6.4.0 target:6.3.4
Keywords: bibisected, bisected, filter:xlsx, regression
Depends on:
Blocks: XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2019-11-07 12:29 UTC by Elmar
Modified: 2019-11-11 13:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
ods file created bt Calc (26.66 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-11-07 12:33 UTC, Elmar
Details
the file as fixed by office365 (23.28 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-11-07 12:34 UTC, Elmar
Details
the fixed file saved as an ods by office365 (11.46 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-11-07 12:35 UTC, Elmar
Details
attempted fix (11.80 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-11-07 16:56 UTC, Eike Rathke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar 2019-11-07 12:29:41 UTC
Description:
When saving calc file, office365 reports that it needs to be fixed before use.

Steps to Reproduce:
1. create spreadsheet in Calc
2. save to xlsx
3. open using Office365

Actual Results:
Excel reports that it needs to be fixed before opening

Expected Results:
Should not require fixing


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Elmar 2019-11-07 12:33:09 UTC
Created attachment 155607 [details]
ods file created bt Calc
Comment 2 Elmar 2019-11-07 12:34:06 UTC
Created attachment 155608 [details]
the file as fixed by office365
Comment 3 Elmar 2019-11-07 12:35:13 UTC
Created attachment 155609 [details]
the fixed file saved as an ods by office365
Comment 4 Xisco Faulí 2019-11-07 12:52:33 UTC
Reproduced in

Version: 6.4.0.0.alpha1+
Build ID: b19c5d4286f66193173534980d18992682905e26
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

and MSO 2010
Comment 5 Xisco Faulí 2019-11-07 12:59:21 UTC
Regression introduced by:

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
commit d0f8daa0980ba8e403b32006831657c5a0a4ea17 (patch)
tree 1baf7f73a6fd5d1c7555403b21e223d7736a9b31
parent 50c9ed67d29d6105f3907cb7a2fe3322685af53c (diff)
Resolves: tdf#73063 preserve and roundtrip LCID from/to Excel number formats

Bisected with: bibisect-linux64-6.2 

Adding Cc: to Eike Rathke
Comment 6 Eike Rathke 2019-11-07 15:20:09 UTC
I think I know what makes it stumble, one of the en-ZA R (ZAR) currency formats (the one used in style "Curr" that also sets a fixed en-ZA locale) duplicates the LCID, but need to investigate when/how to prevent that.

Style "Curr" apparently is not used in the document, deleting it should workaround the problem. Or if the attached document is just an excerpt and the original document uses the style, then changing the number format's locale/language to Default (like in style "Result2") should also fix it.
Comment 7 Eike Rathke 2019-11-07 16:56:31 UTC
Created attachment 155612 [details]
attempted fix

Can someone please check if Excel (365) loads this document without complaining?
The duplicated LCID is removed, but this now results in two identical format code strings for numFmtId="165" and numFmtId="166". That should not harm, but.. it's Excel. This loses the fixed locale assignment for the currency format in style "Curr" when reloading in LibreOffice, but having both is not possible.
Comment 8 Xisco Faulí 2019-11-07 16:59:51 UTC
(In reply to Eike Rathke from comment #7)
> Created attachment 155612 [details]
> attempted fix
> 
> Can someone please check if Excel (365) loads this document without
> complaining?
> The duplicated LCID is removed, but this now results in two identical format
> code strings for numFmtId="165" and numFmtId="166". That should not harm,
> but.. it's Excel. This loses the fixed locale assignment for the currency
> format in style "Curr" when reloading in LibreOffice, but having both is not
> possible.

Hi Eike,
at least MSO Excel 2010 doesn't complain, can't test it with 365 myself but I'll ask in the qa channel
Comment 9 Commit Notification 2019-11-08 08:40:08 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3b49477c31692730f15dc571c823515889ccaec9

Resolves: tdf#128649 Do not insert duplicate LCID for currency

It will be available in 6.4.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 10 Commit Notification 2019-11-08 08:40:16 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3e71ec4dd593d4c7d904a8617be5808a0c0f02b1

Unit test for fixed locale Excel export formats, tdf#128649

It will be available in 6.4.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 2019-11-08 09:35:17 UTC
Pending review https://gerrit.libreoffice.org/82265 for 6-3
Comment 12 Xisco Faulí 2019-11-11 12:56:59 UTC
Verified in

Version: 6.4.0.0.alpha1+
Build ID: fea5c10e222b10d83e0081dc1d1b2e678689d250
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Eike, thanks for fixing this issue!
Comment 13 Commit Notification 2019-11-11 13:01:46 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/1f01cf55897582ace26795f21ec548d3a5906c7c

Resolves: tdf#128649 Do not insert duplicate LCID for currency

It will be available in 6.3.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.