Bug 71809 - FILESAVE - DOC file loads well but saving as DOC / DOCX fails: document is almost blank except one image
Summary: FILESAVE - DOC file loads well but saving as DOC / DOCX fails: document is al...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: (target:4.2.0)
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-19 20:36 UTC by leo
Modified: 2014-05-30 06:02 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
offending document (37.99 KB, application/msword)
2013-11-19 20:36 UTC, leo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description leo 2013-11-19 20:36:15 UTC
Created attachment 89487 [details]
offending document

I got this DOC file from my employer (see attachment). 

After working it, I saved it as DOC again. Stupidly enough, all my changes were gone and only an image + one table cell remained. Everything else: gone. 

Saving copy as DOCX: same story.

Saving copy as ODT: fine

Saving copy as ODT, and THEN docx: bad again.
Comment 1 Jorendc 2013-11-20 17:45:50 UTC
Hi Leo,

When I save your attached test document, save it as (docx, doc or odt) and reopen it using LibreOffice result in the same/unaffected document as original.

As far I can see this is the "corrupted" document? Although it's the "corrupted document" I did some test:

tested using Mac OSX 10.9 with LibreOffice Version: 4.1.3.2 Build ID: 70feb7d99726f064edab4605a8ab840c50ec57a and LibreOffice Version: 4.2.0.0.alpha1+
Build ID: 9c45345a680f7444df251f9403c7d56572380f21 TinderBox: MacOSX-x86@49-TDF, Branch:master, Time: 2013-11-18_12:43:03

Actually, in master 4.2.0.0 the document is displayed "correctly", but it's in portrait-layout, not in landscape.
Comment 2 leo 2013-11-20 20:30:15 UTC
(In reply to comment #1)
> Hi Leo,
> 
> When I save your attached test document, save it as (docx, doc or odt) and
> reopen it using LibreOffice result in the same/unaffected document as
> original.
> 
> As far I can see this is the "corrupted" document? Although it's the
> "corrupted document" I did some test:
> 
> tested using Mac OSX 10.9 with LibreOffice Version: 4.1.3.2 Build ID:
> 70feb7d99726f064edab4605a8ab840c50ec57a and LibreOffice Version:
> 4.2.0.0.alpha1+
> Build ID: 9c45345a680f7444df251f9403c7d56572380f21 TinderBox:
> MacOSX-x86@49-TDF, Branch:master, Time: 2013-11-18_12:43:03
> 
> Actually, in master 4.2.0.0 the document is displayed "correctly", but it's
> in portrait-layout, not in landscape.

Hi Joren, 
thanks for you quick followup. The file I attached is indeed the "unaffected" file, before the corruption so to say. Steps to repeat the problem are:
1) Open file
2) Save as Copy --> keep name but with extension DOCX
3) Close Libreoffice
4) Open DOCX file. This is now corrupted.

Also happens if you save to native ODT inbetween 1) and 2). 

I'm on Ubuntu 12.04 with additional Libreoffice PPA
$ libreoffice --version
LibreOffice 4.1.3.2 410m0(Build:2)
Comment 3 Jorendc 2013-11-20 20:40:34 UTC
Well, I got a little other behavior right now.

I can reproduce this behavior, tested using Mac OSX 10.9 with LibreOffice Version: 4.1.3.2 Build ID: 70feb7d99726f064edab4605a8ab840c50ec57a

I CAN'T using Version: 4.2.0.0.alpha1+
Build ID: 9c45345a680f7444df251f9403c7d56572380f21
TinderBox: MacOSX-x86@49-TDF, Branch:master, Time: 2013-11-18_12:43:03

But as I already remarked in Comment 1, opening the original file in 4.2 the page orientation is wrong (portrait instead of landscape).

So: problem looks fixed with 4.2.0, but another problem appeared. I'll create a new bug report for that. Not sure the fix is backportable to 4.1-branch. Lets try to bibisect this one, and see which commit solved the issue.

Kind regards,
Joren
Comment 4 Jorendc 2013-11-20 20:50:44 UTC
Create Bug 71853 for page orientation regression bug.

Kind regards,
Joren
Comment 5 leo 2013-11-22 09:45:54 UTC
Joren,

Indeed the correct orientation is landscape. I can confirm this by opening the file in MS Word. 

I've done some more testing on my own. The FILESAVE defect in question does not seem to be related to the DOC format per se. That is, at my WIndows workstation I've converted the .doc file to .docx and sent it to Ubuntu/LibreOffice. There, I could correctly open the file, but saving would again result in corruption. 

Could it have something to do with specific Macro's/tables used in this document? Normally I don't have problems writing to .docx. 

Leo
Comment 6 Joel Madero 2014-05-30 06:02:05 UTC
Seems to me like this is WFM - the original report was about corrupted file which is resolved in 4.2. 4.1 is EOL so won't get any more updates. If the landscape issue still exists please report a new bug. Thanks!