Bug 96049 - FILESAVE: Spreadsheets corrupted on XLSX roundtrip (TableRef?)
Summary: FILESAVE: Spreadsheets corrupted on XLSX roundtrip (TableRef?)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.1.0 target:5.1.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-25 03:00 UTC by Luke
Modified: 2016-10-25 19:20 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the Error (17.27 KB, image/png)
2015-11-25 03:00 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2015-11-25 03:00:32 UTC
Created attachment 120773 [details]
Screenshot of the Error

I have noticed that recent builds of LibreOffice generate invalid OOXML Excel files that cannot be opened by Excel 2010.

Steps to reproduce:
1.In a recent build of LO open attachment 81708 [details]
2.Save
3.Open in the saved file with Excel
4.Repeat steps 1-3 with a Calc <= 5.0
Files saved with Calc  > 5.0 will display the following mes in Excel:
“Excel found unreadable content in ‘<filename>’. Do you want to recover the content? 
If you click Yes 
“Excel was unable to open the file by repairing” -> “Replaced Part: /xl/worksheets/sheet1.xml part with XML error.  Load error. Line 2, column 0.”
The file will be empty.

I binary bisected this down to: 
http://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=5191fcb11688ef8f4ec312293e57e151762c6952..cf9fbdb379e2935677a73ced513d7faf855c299c

Since this only appears to affect my files with structured references, it is likely due to one of the TablreRef: commits in that range.
Comment 1 Eike Rathke 2015-11-25 17:27:22 UTC
Funny enough LibreOffice can read the resulting file again..
Comment 2 Eike Rathke 2015-11-25 20:29:49 UTC
Sigh.. apparently Excel expects the <tableParts> element to appear before the <extLst> element within a <worksheet> element. Which means having to move everything table related into the XclExpRecordList and manage as records. Oh fun :-/
Comment 3 Commit Notification 2015-11-26 10:41:31 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4112ecadd53f7ae48e007dd5024f077aca305062

TableRef: write <tableParts> before <extLst>, resolves tdf#96049

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2015-11-26 10:51:52 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fa18c83e4e2bddf8f25e4dc3b93ba667ec2a8c11&h=libreoffice-5-1

TableRef: write <tableParts> before <extLst>, resolves tdf#96049

It will be available in 5.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.