Bug 102377 - FILESAVE: Saving as XLSX resulted in Corrupted file
Summary: FILESAVE: Saving as XLSX resulted in Corrupted file
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks:
 
Reported: 2016-09-23 02:55 UTC by Luke
Modified: 2016-10-02 23:30 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample Bad Spreadsheet saved after Regression (4.91 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-10-02 07:13 UTC, Luke
Details
Sample Good Spreadsheet saved Before Regression (4.28 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-10-02 07:14 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2016-09-23 02:55:56 UTC
User-Agent:       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Build Identifier: a3504b128c752c8fccd55bfc7e2db24f1db53337

Recent builds of Calc are generated corrupt files that need to be repaired to open in Excel 2013.

Reproducible: Always

Steps to Reproduce:
1. With a recent build of Calc type some text in a cell
2. Save as XLSX
3. Open In Excel
Actual Results:  
Excel says "We found a problem with some contents in xxx.xlsx. Do you want us to try to recovered as much as we can?" Then 
"Repaired Records: Font from /xl/styles.xml part (Styles)"

Expected Results:  
Open without error.

This is a regression. Earlier builds such as Build ID: cf31f48acca45396588aa410ddbe613b92f9fbce  generated valid XLSX files that opened in Excel without errors.


Reset User Profile?
Comment 1 Luke 2016-10-02 07:04:41 UTC
I narrowed this commit down to this range.
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=e28d52387383d5b9b3554f364e885a20f4292d81..d15082cac2306fb9562ff126eb5827b7b9eee1e1


Jaskaran or Markus 
Could your orcus style code in that range be responsible for corrupting /xl/styles.xml?
Comment 2 Luke 2016-10-02 07:13:36 UTC
Created attachment 127773 [details]
Sample Bad Spreadsheet saved after Regression
Comment 3 Luke 2016-10-02 07:14:24 UTC
Created attachment 127774 [details]
Sample Good Spreadsheet saved Before Regression
Comment 4 Jaskaran Singh 2016-10-02 09:56:35 UTC
Hi Luke,
Thanks for bringing this bug to our notice. Unfortunately, I don't have Excel installed on my machine so can't confirm this bug. However, it looks like it is because of FreeSans Font being introduced into the styles.xml that makes it corrupted.

Anyways, this set of styles was just made for testing the new feature that we had. I will replace this with actual styles in a few hours once my commit is built by jenkins. This bug will probably be fixed after it. But we need to investigate deeper as to why this happens. Looks like a flaw somewhere in the area where we convert the attributes to the xlsx ones.

I need someone more knowledgeable to confirm if I'm correct or not.
Comment 5 Luke 2016-10-02 17:57:47 UTC
Jaskaran,
You don't need excel to verify this bug, just go to 
https://onedrive.live.com/
If you try to upload the file, you'll get the following error:
"We're sorry we could not open your workbook. It may be corrupt or use a format the we do not support"


Also I tried to narrow down the exact commit, but I kept getting build errors. I was able to reduce the rage to this:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=e28d52387383d5b9b3554f364e885a20f4292d81..3287bc2f91438085b7604773d5e0346fc3c3f452
Would it help for me to try to whittle the range down more?

I'll try a recent build tonight and report back if it's fixed or not.
Comment 6 Luke 2016-10-02 23:30:01 UTC
Verified working in Version: 5.3.0.0.alpha0+ (x64)
Build ID: 06f319937187f76ee402d53b3baa78c391c2af19

Jaskaran,
It appears that 06f319937187f76ee402d53b3baa78c391c2af19 has fixed the issue. Thank you!