Bug 91064 - FILESAVE: Docx Corrupted on Round-Trip
Summary: FILESAVE: Docx Corrupted on Round-Trip
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.0.0.0.alpha0+ Master
Hardware: Other All
: highest critical
Assignee: Not Assigned
URL:
Whiteboard: target:5.0.0
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-05-04 06:21 UTC by Luke
Modified: 2015-05-15 18:17 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Empty document saved as docx from Office 2013 (10.94 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-05-09 19:21 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2015-05-04 06:21:57 UTC
Steps to reproduce:
1. Open any Word Docx with a Chart such as attachment 115115 [details] or attachment 97015 [details] in a recent 5.0 build of Calc
2. Save as Docx
3. Open in MS Word
4. Repeat Steps 1-3 in build of Calc before 2015-04-23

In recent builds, Words says "We're sorry. We can't open 016.docx because we found a problem with its contents. 
The file is corrupt and cannot be opened."

Bad:
Version: 5.0.0.0.alpha1+
Build ID: 93f0b14458a618ad575cd446680e5c4aa7d87bdc


I have to boot into Windows to bisect this bug. Is there a tinderbox that saves Windows builds for more than a few days?
Comment 1 Luke 2015-05-04 10:12:22 UTC
Before the windows tinderbox builds faded into the ether, I bisected this down to: 

Version: 5.0.0.0.alpha1+
Build ID: 0ecf20cd185813327613c01bc6cbff9721cef1f1
good

Version: 5.0.0.0.alpha1+
Build ID: 393c51cee8bc3de5a2a9f4e04161c59e8712f631
bad

http://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=+0ecf20cd185813327613c01bc6cbff9721cef1f1..393c51cee8bc3de5a2a9f4e04161c59e8712f631

possible culprit:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=480ca7434a330b2678f9ef287cffd6d9cf27bed5

Miklos what do you think? Also I was testing against MSO 2013.
Comment 2 Luke 2015-05-04 22:31:27 UTC
A quick way to reproduce this bug is in Writer
1. Create a blank file 
2. "save as" DOCX 
3. Open in Word 2013

Verified this is caused by:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=480ca7434a330b2678f9ef287cffd6d9cf27bed5

Last known good commit: 861a86dfca00bc42b57d70621605d5831e6305a5
Comment 3 Radu 2015-05-07 07:33:57 UTC
Luke please add an empty document saved as docx from Office 2013. Thank you!
Comment 4 Yousuf Philips (jay) (retired) 2015-05-07 11:56:48 UTC
Tested this with all the below combinations and MS Word gave an error each time saying that it doesnt understand the version number and could couldnt open it or would repair the file. Seems the AppVersion tag is exclusive to MSO version numbers.

5.0.0.0.alpha1$Linux_x86 LibreOffice_project/1aa43709f1eafe76bb5b2c658bf88c16bb73ea4f

5.0.0.0.alpha1$Linux_x86 LibreOffice_project

5.0.0.0.alpha1

5.0.0

5.0

5.000
Comment 5 Luke 2015-05-09 19:21:05 UTC
Created attachment 115477 [details]
Empty document saved as docx from Office 2013
Comment 6 Jorendc 2015-05-10 18:10:18 UTC
(In reply to Luke from comment #2)
> Verified this is caused by:
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=480ca7434a330b2678f9ef287cffd6d9cf27bed5

Indeed, reverting this commit resolves the problem

Kind regards,
Joren
Comment 7 Luke 2015-05-12 20:15:07 UTC
Jay and Radu,
If you don't have an immediate fix for this issue, can you please revert commit 480ca7434a330b2678f9ef287cffd6d9cf27bed5? Markus is in the midst of a major cleanup of the chart OOXML export code, but I have no way of testing if his fixes also also working in MSO.
Comment 8 Commit Notification 2015-05-15 18:16:36 UTC
Joren De Cuyper committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1e49e40c3694cd5750b65fc726b9684ae4185d4f

tdf#91064: Revert "tdf#89790 DOCX: saving LO version number in app.xml"

It will be available in 5.0.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 9 Jorendc 2015-05-15 18:17:51 UTC
Patch reverted. It looks like Microsoft only accept it own versions.
Nice work though Radu!

Kind regards,
Joren