Bug 89858 - Filesave as DOCX looses text, 3 of 7 pages saved
Summary: Filesave as DOCX looses text, 3 of 7 pages saved
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.0.beta1
Hardware: Other All
: high critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on: 89100
Blocks:
  Show dependency treegraph
 
Reported: 2015-03-06 09:13 UTC by Timur
Modified: 2020-11-06 15:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test 2007 DOCX compared MSO LO (84.69 KB, image/png)
2020-10-12 10:33 UTC, Timur
Details
Test DOCX resaved in MSO and compared MSO LO (101.85 KB, image/png)
2020-10-12 10:36 UTC, Timur
Details
Test DOCX resaved in MSO (153.20 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-10-12 10:39 UTC, Timur
Details
Test DOC saved in MSO and compared MSO LO (107.73 KB, image/png)
2020-10-12 10:42 UTC, Timur
Details
Test DOC saved in MSO (291.00 KB, application/msword)
2020-10-12 10:43 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2015-03-06 09:13:55 UTC
While reviewing attachment 97273 [details] in bug 77374, I noticed another problem, at least in Windows. 

Filesave as DOCX looses text, so 7 pages is saved as 3 pages, but not easy to determine from which LO version, because: 
- up to LO 4.1 text was NOT lost
- LO 4.2 didn't open DOCX properly at all up to 4.2.2, there were not 7 pages, but it was fixed and text is NOT lost after that up to now with LO 4.2.8
- text IS lost in LO 4.3 up to LO 4.3.6 and LO 4.4 up to LO 4.4.1

- text was NOT lost again in some previous LO 4.5.0 master, I think I tested with libo-master~2015-01-19_06.12.03_LibreOfficeDev_4.5.0.0.alpha0_Win_x86
- document cannot be open and tested with LO 4.5.0 master now, which is another  Bug 89100 - FILEOPEN: DOCX - File no longer opens.

I will set as "regression" because filesave worked fine, and mark version as 4.3.0. because current behavior started there. I mark as Critical because of data loss.
Further testing desired and possible backport of fix to 4.4 and 4.3.
Comment 1 MM 2015-03-06 13:12:25 UTC
Confirmed with V4.3.6.2 under window 7 x64.
Confirmed with V4.4.1.2 under mint 17.1 x64.

But this one is odd. If you save the docx file as another docx file, you'll lose data.
If you save it first as odt, reopen the odt and *then* save it as docx file, no data loss.
Comment 2 Matthew Francis 2015-03-17 04:21:15 UTC
Bibisect results from 43all:
This older regression (not the current 4.5 master issue which obscures it(?)) occurred in the below range

The first bad commit could be any of: a79f817930f3cec0a793e0c5f4d0ffbb9737ac3a f959d021204b91b8ee86f06e3e1325187f5c8da5 683c3eda854d9b4a712c53119b62c79a3ef7a4b1


The most likely candidates in that range are probably the following:

commit cbcc6189e300b6aa5e9e8e6883598a4d28b770c0
Author: Ravindra Vidhate <ravindra.vidhate@synerzip.com>
Date:   Mon Apr 28 15:05:54 2014 +0530

    fdo#77887 :  Floating Table positions are not preserved when doing Export

commit f6eb92406bd366c557bc07810649e7ab3d1db614
Author: Pallavi Jadhav <pallavi.jadhav@synerzip.com>
Date:   Tue Apr 29 18:44:16 2014 +0530

    fdo#77812 :FILESAVE :DOCX : Extra Section Break gets added in file
Comment 3 Timur 2015-04-03 16:19:40 UTC
Thank you Matthew. I was free to add ravindra.vidhate@synerzip.com, pallavi.jadhav@synerzip.com to CC.
Comment 4 Matthew Francis 2015-04-13 12:58:15 UTC
It appears to have been this one:

commit cbcc6189e300b6aa5e9e8e6883598a4d28b770c0
Author: Ravindra Vidhate <ravindra.vidhate@synerzip.com>
Date:   Mon Apr 28 15:05:54 2014 +0530

    fdo#77887 :  Floating Table positions are not preserved when doing Export
    
    The margin of the floating table from top of the page is not being preserved correctly and it also get increased.
    
    The w:tblpPr tag is also not preserved.
    
    Reviewed on:
        https://gerrit.libreoffice.org/9185
    
    Change-Id: I8a27a4bab94a1afd27a7ba49ca55ff014918fffc
Comment 5 Ravindra Vidhate 2015-04-14 09:32:29 UTC
Let me took a look at it.
Comment 6 Timur 2015-05-22 07:52:34 UTC
Ravindra, 
Are you still working on this one? If yes, please add yourself to Assigned to. Thanks!
Comment 7 Timur 2015-11-12 16:49:09 UTC
What a messy bug. 5.0.3 still can't open it but 5.1 alpha 1 saves 7 pages. WFM.
Comment 8 Robinson Tryon (qubit) 2015-12-15 11:03:17 UTC Comment hidden (obsolete)
Comment 9 Timur 2020-10-12 10:26:52 UTC
Bibisect LO 5.0max:

commit c31f1935b1a57b1a93781fc90b4afcfbf640d90a
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Wed May 27 16:48:24 2015 +0800

    source-hash-c1e1757cdab6e61b94244761227b0a1f112e6b0c
    
    commit c1e1757cdab6e61b94244761227b0a1f112e6b0c
    Author:     Miklos Vajna <vmiklos@collabora.co.uk>
    AuthorDate: Fri Nov 28 18:11:23 2014 +0100
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Fri Nov 28 18:11:23 2014 +0100
    
        DOCX import: ignore <w:tblpPr> in shape text

   previous source-hash-b2d3f9b5a12928127b476b10599069efea0ddcde

Single commit:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=b2d3f9b5a12928127b476b10599069efea0ddcde..c1e1757cdab6e61b94244761227b0a1f112e6b0c

Since no other bug was referenced, I set this one as Fixed. 

attachment 97273 [details] is 6-pages MSO created 2007 DOCX. 
As fix shows, this was fileopen problem upon save.
Comment 10 Timur 2020-10-12 10:33:25 UTC
Created attachment 166294 [details]
Test 2007 DOCX compared MSO LO

While MSO opens 6 pages with original 2007 DOCX, LO up 7.1+ opens 7 pages due to slightly insufficient table column width in "50-29" (which pushes down "Unterschrift Eltern").
Comment 11 Timur 2020-10-12 10:36:50 UTC
Created attachment 166295 [details]
Test DOCX resaved in MSO and compared MSO LO

If 2007 DOCX is resaved in MSO, it opens fine with 6 pages in LO 7.1+.
So I will not report a bug for fileopen of 2007 DOCX.
Comment 12 Timur 2020-10-12 10:39:23 UTC
Created attachment 166296 [details]
Test DOCX resaved in MSO
Comment 13 Timur 2020-10-12 10:42:37 UTC
Created attachment 166297 [details]
Test DOC saved in MSO and compared MSO LO

If document is saved in MSO 2016 as DOC, it opens fine with 6 pages in LO 7.1+.
Comment 14 Timur 2020-10-12 10:43:07 UTC
Created attachment 166298 [details]
Test DOC saved in MSO
Comment 15 Timur 2020-10-12 11:04:23 UTC Comment hidden (me-too)
Comment 16 Timur 2020-10-12 11:16:05 UTC
attachment 97273 [details] had more issues, like bug 89100 etc, so UI test would be nice for opening and resaving as DOCX (and DOC?). 
only, UI for resaving should be done with MSO-updated attachment 166296 [details].
Comment 17 Xisco Faulí 2020-11-06 15:24:45 UTC
(In reply to Timur from comment #16)
> attachment 97273 [details] had more issues, like bug 89100 etc, so UI test
> would be nice for opening and resaving as DOCX (and DOC?). 
> only, UI for resaving should be done with MSO-updated attachment 166296 [details]
> [details].

Hi Timur,
Thanks for the reverse bisection.
The mentioned commit already has an ooxml export unittest. See the path: 	sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
I don't think we need another one for this.