Bug 93229 - DOC files containing forms get corruption after editing and save
Summary: DOC files containing forms get corruption after editing and save
Status: RESOLVED DUPLICATE of bug 52555
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:doc
Depends on:
Blocks: DOC
  Show dependency treegraph
 
Reported: 2015-08-07 09:47 UTC by Ivan Levshin
Modified: 2017-08-22 10:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
An example of Word file containing form (47.50 KB, application/msword)
2015-08-07 09:47 UTC, Ivan Levshin
Details
An example of edited file (30.00 KB, application/msword)
2015-09-22 08:36 UTC, Ivan Levshin
Details
Same original file edited in MS Word 2007 (48.50 KB, application/msword)
2015-09-23 06:08 UTC, Ivan Levshin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Levshin 2015-08-07 09:47:35 UTC
Created attachment 117736 [details]
An example of Word file containing form

If you edit&save Word document containing a form, all form-related data removing during save. Later file can be opened but cannot be proceeded by any automatization tool provided by MS Office.

I have attached an example of such a file.

After editing file becomes smaller (around 40-50K before editing, 10-20K after editing). It seems like all form data removed during save.

If you edit same file in MS Word, no such corruption occurs.
Comment 1 Yousuf Philips (jay) (retired) 2015-09-22 07:35:31 UTC
Hi Ivan,

Thank you for submitting the bug report. I'm unable to reproduce this on master, as saving the file and opening it in MS Word 2010 works fine for me, and is a ~30k file. Can you send an example edited file, so i can test your results? Which version of MS Word are you testing it against?

Version: 5.1.0.0.alpha1+
Build ID: 1e67e94f1a308ca60d4934e9fe9d5c048225ebe8
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-09-21_07:28:58
Locale: en-US (en_US.UTF-8)
Comment 2 Ivan Levshin 2015-09-22 08:36:07 UTC
Created attachment 118926 [details]
An example of edited file

Hi Yousuf,

Thanks for your reply. The problem itself it's a file damage, I didn't write anything like "I cannot edit that file". I can do that, yes - and I can save results and file might be opened in both LibreOffice and MS Office without any problem. The problem here is that internal macros structure seems to be lost during save after editing.

Please check the output from my machine:

ivan@levshin-host:~/4> ll *.doc
-rw-r----- 1 ivan users 48640 сен 22 11:27 e-ProVisa Form_Moscow.doc
-rw-r--r-- 1 ivan users 30720 сен 22 11:29 e-ProVisa Form_Moscow (edited).doc

As you can see, edited file is smaller in size - but will be little big bigger as data was added here. Finally such visa application letters will be rejected by Cyprus embassy as they are unable to proceed such an application form. This is a big problem for my wife and the only thing why they need MS Office.
Comment 3 Yousuf Philips (jay) (retired) 2015-09-22 11:58:03 UTC
Hi Ivan,

I opened the original file in MS Word 2010 and dont see any macro embedded in the file. Just because it has a smaller file size doesnt mean that data is being lost. Can you pinpoint exactly what is there in the original .doc file that isnt there in the libreoffice saved .doc file?
Comment 4 Ivan Levshin 2015-09-22 13:53:59 UTC
Yusuf,

I'm not sure about exact internal structure of original MS Word DOC - it was just a supposition that it contains macros. It will contain something like fields emvedded, I think Embassy collects all of such filled-in forms and proceed them automatically. Lost fields will be the only reason of why such application forms being rejected - script/program used for proceeding it just can't do nothing. Unfortunately I have no feedback from them except of "Wrong file, please use MS Word for editing original form".

I did short analysis and the very first thing was size difference - after editing original file in MS Word it becomes a little big bigger. After Writer file is a much smaller (almost twice) - that's why I decided that something lost during save. If I just open and close original file without saving it - everything is fine, size is the same, I can edit the file in MS Word and after that there is no problem with processing that form. At least I have no complains from Embassy regarding files edited&saved in MS Word.

This thing making me insane. My wife's office works with LibreOffice since 3.0 and almost happy, but this problem forcing them to use MS Word. Right now it's the only reason why they keep MS Word and Writer installed and my wife wants to choose 1 application to be used in her office.
Comment 5 Ivan Levshin 2015-09-23 06:08:20 UTC
Created attachment 118961 [details]
Same original file edited in MS Word 2007

Hi Yousuf,

Checked again your comment and found that I missed its part. Please check an example of same original file edited with MS Word 2007. As you can see, it's bigger in size than original file and much more bigger than result file from Writer:

ivan@levshin-host:~/4> ll *.doc
-rw-r----- 1 ivan users 48640 сен 22 11:27 e-ProVisa Form_Moscow.doc
-rw-r--r-- 1 ivan users 30720 сен 22 11:29 e-ProVisa Form_Moscow (edited).doc
-rw-rw-rw- 1 ivan users 49664 сен 23 09:04 e-ProVisa Form_Moscow (MS Word edited).doc
Comment 6 Yousuf Philips (jay) (retired) 2015-09-25 10:38:42 UTC
Hi Ivan,

Well unfortunately i'm not technical enough to know what may have been removed from the saved document, so i'll pass it onto a developer who does.

@Michael: Can you look into this? Could this be caused by bug 94431?
Comment 7 Buovjaga 2015-10-10 12:35:12 UTC
Observations related to attachment 117736 [details]:
MS Word 2013 opens it in a state where you have to select View - Edit to be able to input stuff. This is typical of these form .doc documents - I just recently ran into one.
When I input stuff into the fields in LibO, the grey background does not adjust to the typing like in MS Word, but instead more grey blocks are created.
When I save a version from LibO and open it with MSO, it is no longer in the state where I have to click View - Edit!!
Now when I type to the fields in MS Word, the grey background disappears!

I'll set to NEW as there is clearly some loss of document structure.

Win 8.1 32-bit
MSO 2013
LibO Version: 5.0.3.1
Build ID: fd8cfc22f7f58033351fcb8a83b92acbadb0749e
Locale: fi-FI (fi_FI)
Comment 8 Robinson Tryon (qubit) 2015-12-10 10:13:24 UTC Comment hidden (obsolete)
Comment 9 Xisco Faulí 2016-09-19 15:29:46 UTC Comment hidden (obsolete)
Comment 10 Lev Melnikovsky 2017-07-28 09:26:44 UTC
-the same embassy, the same problem
Libreoffice 5.2.7.2 (Gentoo official build)
Comment 11 Timur 2017-08-22 10:07:14 UTC
Looks like a duplicate of Bug 52555.

*** This bug has been marked as a duplicate of bug 52555 ***