Created attachment 174428 [details]
Sample file provided by the original reporter
This is a bug report translated and forwarded from a Chinese LibreOffice user forum. The original report (in Chinese) is:
The XLSX format files exported from 金蝶 (Kingdee) ERP system's web tools can't be opened by LibreOffice, while MS Office and Kingsoft WPS open them correctly. Sample file attached.
From the analysis in the original report, it seems the culprit is in the XLSX file's docProps/custom.xml file. It starts with (after the mandatory <?xml version="1.0"?> line):
<q1:Properties xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:q1="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties">
If one changes that line to
<q1:Properties xmlns:q1="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" ...
i.e., move the "xmlns:q1" part to the first place, the file can be opened by LibreOffice.
I don't know what the OOXML standard says, but since MS Office accepts such a file, unless it's strictly forbidden by the standard, having LO allow such a small deviation from the proper order should be beneficial to users.
I can reproduce that neither LO 7.0.6 or 7.2.0 RC3 can open the attached sample file:
Version: 184.108.40.206 (x64)
Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b
CPU threads: 2; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: zh-CN (zh_CN); UI: en-US
Version: 220.127.116.11 (x64) / LibreOffice Community
Build ID: 2a7ea282da28d665a7dc086360567b4aea27bf08
CPU threads: 2; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
7.2.0 RC3 first claims the file may be damaged and offers to repair it, but when told "yes", can not repair and returns "General input/output error". 7.0.6 just gives "General input/output error" directly.
Another user (not the original reporter) can reproduce that the sample file opens in MS Office 2016 for Windows and MS Office 365 for Mac without problems.
I confirm the problem. I have tested with Version: 18.104.22.168.alpha0+ (x64) / LibreOffice Community
Build ID: d51c383b0204057e1b341db2d38b6d2dbb0c84e8
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
The validator in "Open XML SDK 2.5 Productivity Tool for Microsoft Office" reports no errors for this file.
There are multiple bugs for generated files.
This one opens if simply unzipped and rezipped.
Let's keep with another similar case.
*** This bug has been marked as a duplicate of bug 76115 ***
(In reply to Timur from comment #2)
> This one opens if simply unzipped and rezipped.
Thanks Timur. I can confirm that simple unzipping and rezipping generates a file that opens fine in LO, the docProps/custom.xml thing turns out to be just a red herring.
I've posted this information back to the original Chinese thread. Hope the interested parties can find out the root cause of this issue.
I debugged and find that the test file reported in bug 143958 raised
"ZipException: PK64 zip file entry /home/suokunlong/lo/source/core/package/source/zipapi/ZipFile.cxx:950"
Thus this bug should not be marked as a duplicate bug 82984 instead.
*** This bug has been marked as a duplicate of bug 82984 ***