Bug Hunting Session
Bug 82553 - FILEOPEN: Wrong import of DOCX with table (Summary in Comment 3)
Summary: FILEOPEN: Wrong import of DOCX with table (Summary in Comment 3)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.0 beta1
Hardware: Other All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.1.0 target:5.0.0.0.beta3 tar...
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2014-08-13 10:37 UTC by Priyanka Gaikwad
Modified: 2016-09-29 15:15 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Docx (79.62 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-08-13 10:37 UTC, Priyanka Gaikwad
Details
Table preview with MSO 2010.pdf (497.07 KB, application/pdf)
2015-01-16 15:11 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Priyanka Gaikwad 2014-08-13 10:37:28 UTC
Created attachment 104554 [details]
Docx

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

Current behavior :
File get hang while saving the DOCX

Expected behavior :
File Should save properly.
Comment 1 Priyanka Gaikwad 2014-08-13 10:39:54 UTC
The attached file took around 10 mins to save
Comment 2 tommy27 2014-08-13 18:35:23 UTC
it hangs with 4.3.0.4 as well. tested under Win7x64
Comment 3 Timur 2014-11-28 16:43:35 UTC
Saving works fine now with 4.3.5.1 and 4.4 beta. 
So this bug should be closed with WORKSFORME (and another bug open) or title changed to another bug: Wrong import of DOCX with table. 

This file looks differently in all LO versions: up to 3.5 with 4 pages and with wrong colors, in 3.6 with 3 pages and fine colors, in 4.0 and 4.1 with 1 page, and in 4.2 and up to now with 2 pages, 1 empty and 1 with table.
So, looks to me that LO 3.6.5 was closest to what it should look like, according to how it opens in MS Office 2010.
Comment 4 tommy27 2014-11-28 19:32:22 UTC
I agree. edited summary.
Comment 5 Timur 2015-01-16 15:11:14 UTC
Created attachment 112351 [details]
Table preview with MSO 2010.pdf
Comment 6 Timur 2015-01-20 13:20:50 UTC
I change Version to 4.0 beta which is the first after proper preview with LO 3.6.7.2. I also add "Regression".
That version looks close to MS Office except bottom margin that differs.
Comment 7 Matthew Francis 2015-02-13 04:41:00 UTC
The document went from 3 pages to 1 as of commit edc4861a68e0269b83b17e0ec57912a1ce4220ad, and gained an extra leading blank page as of commit 26d9efd36a16d2095d8fb885290c6816082ec814

Adding Cc: to vmiklos@collabora.co.uk; Could you possibly take a look at this? Thanks


commit edc4861a68e0269b83b17e0ec57912a1ce4220ad
Author: Miklos Vajna <vmiklos@suse.cz>
Date:   Wed Aug 15 16:31:51 2012 +0200

    n#775899 initial docx import of w:vertAnchor inside w:tblpPr
    
    Change-Id: I5c848a8d4c860a83d6729b8db40f744afad906d5


commit 26d9efd36a16d2095d8fb885290c6816082ec814
Author: Miklos Vajna <vmiklos@suse.cz>
Date:   Thu Aug 15 10:40:35 2013 +0200

    DOCX import: handle w:leftFromText and w:rightFromText for floating tables
    
    Left margin wasn't implemented, that's simple. Right margin of the table
    was set to the cell margin in commit
    53d27a30ce5f2c9f7d37a4089286116854c16215, which turns out to be wrong:
    it's true that the right margin should be >0, but not because of the
    cell margin but because of the table margin. The new behavior matches
    what the binary import always did.
Comment 8 Miklos Vajna 2015-06-05 21:03:28 UTC
When we determine if the table is placed inside a TextFrame or not, we could take the right/left margin of the table into account, that would solve both problems, I think.
Comment 9 Commit Notification 2015-06-08 05:59:25 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=292ec5fe8d01af6119325f1a426422bb42e58615

tdf#82553 DOCX import: handle table margin when converting floattables

It will be available in 5.1.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 10 Commit Notification 2015-06-09 07:50:42 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=233a52af646f73a9ef0d53dd27f2823e8c362728&h=libreoffice-5-0

tdf#82553 DOCX import: handle table margin when converting floattables

It will be available in 5.0.0.0.beta3.

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 11 Timur 2015-06-09 10:26:51 UTC
Now, table looks better: with 3 pages and fine colors. 

What's still wrong:
- table borders are not applied correctly on Fileopen and some are missing
- print from File-Print and Export as PDF scales the table, why?
- print from Print Preview gives just 3 empty pages
Comment 12 Timur 2015-06-09 10:41:04 UTC
Print problem not specific to this file, but to LO 5.1+ in general.

So, can you please see for table borders or that should be a new bug?
Comment 13 Miklos Vajna 2015-06-12 07:58:33 UTC
Please file a separate bug (where the version is not 4.0 beta 1) for the table borders.
Comment 14 Commit Notification 2015-06-16 14:43:19 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=853033da3710f0e8df1b5d0d5355c6b0ce1c9ea0&h=libreoffice-4-4

tdf#82553 DOCX import: handle table margin when converting floattables

It will be available in 4.4.5.

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 15 Timur 2015-06-16 14:50:54 UTC
(In reply to Miklos Vajna from comment #13)
> Please file a separate bug (where the version is not 4.0 beta 1) for the
> table borders.
I did as Bug 92026.
Comment 16 Robinson Tryon (qubit) 2015-12-17 08:29:58 UTC Comment hidden (obsolete)