Bug 80748 - FILESAVE: File getting corrupted after RT due to paragraph gets added into run which has a framePr
Summary: FILESAVE: File getting corrupted after RT due to paragraph gets added into ru...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA target:4.4.0
Keywords:
Depends on:
Blocks: Frame-Dialog
  Show dependency treegraph
 
Reported: 2014-07-01 06:11 UTC by Rohit Deshmukh
Modified: 2017-05-18 19:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Original file (26.46 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-07-01 06:11 UTC, Rohit Deshmukh
Details
FDO78590b.docx - with paragraphs above and below the graphic (lost when roundtripped) (58.35 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-07-29 08:28 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rohit Deshmukh 2014-07-01 06:11:10 UTC
Created attachment 102051 [details]
Original file

Steps to reproduce :
1] Open attached DOCX in LibreOffice
2] Perform save_as DOCX
3] Open saved file in MS Office 2010

Current behavior :
File gets corrupted

Expected behavior :
File should open without any warning or error.
Operating System: All
Version: 4.4.0.0.alpha0+ Master
Comment 1 Commit Notification 2014-07-03 13:37:52 UTC
Rohit Deshmukh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=83d51e5e52688c4c9bc0ad70a511458bb06a242d

fdo#80748: Fix for file corruption due to framePr



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 2 Justin L 2016-07-29 08:28:57 UTC
Created attachment 126462 [details]
FDO78590b.docx - with paragraphs above and below the graphic (lost when roundtripped)

The fix in comment 1 causes one paragraph to disappear each time LO saves the file, so both the "Before graphic" and "After graphic" paragraphs will be deleted after a couple of round-trips.

This fix just throws information away to avoid corruption.  It looks like a couple of "w:pict"s eventually get converted into a couple of "mc:AlternateContent" by the second save, and that is likely what is causing the corruption.  MergeMarks::IGNORE discards the pict information (as well as anything else) and so avoids corruption, but introduces data loss.
Comment 3 Justin L 2016-08-01 05:29:47 UTC
(In reply to Commit Notification from comment #1)

The unit-test referred to in the commit is from bug 78590 and was a copy/paste of the model unit-test above it. The description was left unchanged, so it doesn't at all reflect what is being tested.