Bug 80635 - FILEOPEN: DOC file floating table spacing (margin) not imported properly
Summary: FILEOPEN: DOC file floating table spacing (margin) not imported properly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: Other All
: high major
Assignee: Justin L
URL:
Whiteboard: BSA interoperability target:7.0.0
Keywords: bibisected, bisected, filter:doc, regression
: 76805 97037 97312 100676 (view as bug list)
Depends on:
Blocks: DOC-Tables
  Show dependency treegraph
 
Reported: 2014-06-28 15:17 UTC by Marc PHILIPPE
Modified: 2020-04-22 14:22 UTC (History)
17 users (show)

See Also:
Crash report or crash signature:


Attachments
Original .doc file with resulting .odt, along with screenshots (MS Word viewer + LO) (568.00 KB, application/zip)
2014-06-28 15:17 UTC, Marc PHILIPPE
Details
Original DOC without protection (128.13 KB, application/msword)
2016-08-17 13:22 UTC, Timur
Details
Original DOC without protection, proper encoding (128.00 KB, application/msword)
2018-11-07 21:51 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc PHILIPPE 2014-06-28 15:17:10 UTC
Created attachment 101926 [details]
Original .doc file with resulting .odt, along with screenshots (MS Word viewer + LO)

Problem description: 
When importing a WinWord document containing tables and an image, various settings of the original document are not respected:
- page margins
- table dimensions (margins, column width and row height)
- space between tables

Steps to reproduce:
1. File/Open... with a .doc file.

Operating System: Windows 7
Version: 4.1.2.3 release
Comment 1 Yousuf Philips (jay) (retired) 2014-06-28 23:32:06 UTC
Confirmed in Linux Mint in 4.2.5 and 4.3.0. The table width is correct in 4.0.6.
Comment 2 Cor Nouws 2014-06-29 10:28:07 UTC Comment hidden (obsolete)
Comment 3 Cor Nouws 2014-06-29 10:28:58 UTC Comment hidden (obsolete)
Comment 4 Yousuf Philips (jay) (retired) 2014-06-29 23:16:56 UTC
(In reply to comment #2)
> Hi Jay,
> 
> When commenting, can you pls explain what is confirmed :) ? Marc mentions
> "various settings"
> Ciao,
> Cor

Hi Cor,

I did state what was confirmed with 'The table width is correct' and did change the bug summary to reflect what the issue was, as the only thing wrong is the table width. :)
Comment 5 Marc PHILIPPE 2014-06-30 06:11:02 UTC Comment hidden (obsolete)
Comment 6 Yousuf Philips (jay) (retired) 2014-06-30 12:56:41 UTC
Hi Marc,

Yes our bug system works with one bug per report and the biggest problem i noticed with both the doc and odt is that the table started going out of the page in 4.1, so i made this bug about that. There isnt an issue with the margins because the table is out of the margins to begin with. :)

Please do open an additional bug report regarding the spacing issue, as in 4.1.6 its 5 mm high, but in 4.2.5 and above, its 7 rows high, similar to the exported odt. Once these two issues are dealt with, i assume the document will show up correctly.

The main problem here is that is opening the DOC file improperly, and as a result, it exports it improperly as an ODT.
Comment 7 Marc PHILIPPE 2014-06-30 15:22:41 UTC
(In reply to comment #6)
> [...] Please do open an additional bug report regarding the spacing issue, [...]
Ok: it's bug 80717.
Comment 8 Michael Stahl (allotropia) 2014-07-10 21:52:02 UTC
bibisect range:
 2ede6c95e6481c92cc199e7d74fd36c841636304..1472b5f87314fe660ef1a7b254e51272669f12f6

commit 8fe8bd6c3b5b1a539b7370f8c457fa69c061d2de
Author:     Miklos Vajna <vmiklos@suse.cz>
AuthorDate: Mon May 13 11:24:58 2013 +0200

    Related: fdo#61594 SwWW8ImplReader::StartApo: don't always start a frame


ah another one of those pesky Word floating tables...
Comment 9 Björn Michaelsen 2014-10-16 14:59:13 UTC Comment hidden (no-value, obsolete)
Comment 10 Robinson Tryon (qubit) 2015-12-14 05:19:34 UTC Comment hidden (no-value, obsolete)
Comment 11 Björn Michaelsen 2016-08-14 18:48:09 UTC Comment hidden (no-value)
Comment 12 Timur 2016-08-17 13:17:36 UTC
It's not "width not imported properly" but rather "SPACING not imported properly". Spacing is table spacing, i.e. position. Here it's left and above.
They can be changed manually and it's correct then. 
So, Bug 80717 may be the same and Bug 80869 looks like a duplicate.
Comment 13 Timur 2016-08-17 13:19:35 UTC Comment hidden (obsolete)
Comment 14 Timur 2016-08-17 13:22:59 UTC
Created attachment 126875 [details]
Original DOC without protection

Original DOC is protected and it's show split in Word. Please don't confirmt the bugs with such unproper examples. 
I add the same one without protection. 
Example DOC from the bug I closed as a duplicate: attachment 102217 [details]
Comment 15 Timur 2016-08-17 13:27:07 UTC Comment hidden (obsolete)
Comment 16 Xisco Faulí 2016-09-26 09:26:19 UTC Comment hidden (obsolete)
Comment 17 Xisco Faulí 2016-10-05 16:31:13 UTC
*** Bug 97312 has been marked as a duplicate of this bug. ***
Comment 18 Cor Nouws 2016-10-11 10:21:25 UTC Comment hidden (no-value)
Comment 19 Justin L 2016-12-24 12:37:44 UTC
*** Bug 97037 has been marked as a duplicate of this bug. ***
Comment 20 Xisco Faulí 2017-03-10 13:10:34 UTC
*** Bug 94950 has been marked as a duplicate of this bug. ***
Comment 21 Xisco Faulí 2017-03-10 13:15:20 UTC
*** Bug 94955 has been marked as a duplicate of this bug. ***
Comment 22 Xisco Faulí 2017-10-28 18:22:02 UTC
*** Bug 100676 has been marked as a duplicate of this bug. ***
Comment 23 Timur 2017-11-06 12:12:55 UTC
*** Bug 113672 has been marked as a duplicate of this bug. ***
Comment 24 QA Administrators 2018-11-07 04:02:22 UTC Comment hidden (obsolete)
Comment 25 Adrien 2018-11-07 09:37:59 UTC
Bug 97037 (a duplicate from this one) is still not fixed, using LibreOffice 6.1.3.1.
Comment 26 Luke 2018-11-07 21:51:32 UTC
Created attachment 146414 [details]
Original DOC without protection, proper encoding

I ran into encoding errors when opening the previous copy. This one is created with Word 2016.
Comment 27 Luke 2018-11-09 18:30:48 UTC
I created a stripped down version for testing: attachment 146504 [details]

I also, spun off the 2 page import issue into Bug 121318
Comment 28 QA Administrators 2019-11-11 03:37:30 UTC Comment hidden (obsolete, spam)
Comment 29 Justin L 2020-03-25 08:49:33 UTC Comment hidden (no-value)
Comment 30 Justin L 2020-03-26 11:00:26 UTC Comment hidden (no-value)
Comment 31 Justin L 2020-03-28 07:01:45 UTC Comment hidden (no-value)
Comment 32 Justin L 2020-03-28 07:40:47 UTC
The proposed patches should cover most, if not all, bugs reported here.
-https://gerrit.libreoffice.org/c/core/+/91188 tdf#80635 ww8import:1 take float table CENTER to inlined table
fixes:
    -GE Bilokin Nadia.doc from this bug comment 0
    -GE Bilokin Nadia-fixed.doc from this bug comment 26
    -PageBug.doc from this bug comment 27
    -test file.doc from bug 97312
    -AccountInfo-Sanatized.doc from bug 97037


-https://gerrit.libreoffice.org/c/core/+/91272 tdf#80635 ww8import:2 take float table RIGHT to inlined table
-https://gerrit.libreoffice.org/c/core/+/91273 tdf#80635 ww8import:3 take float table orient to inlined table
fixes:
    -act2.doc from this bug report comment 14's attachment 102217 [details]
    -Resume.doc from bug 97037
    -Document.doc from bug 113672



The following duplicates were vertical alignment problems, which is the topic of bug 80717 which is approximately impossible to solve.
-bug 94950
-bug 94955

Ignoring bug 100676 since it is password protected and thus is a useless test document. There are plenty of other examples, so very safe to ignore this one.
Comment 33 Commit Notification 2020-03-28 07:51:18 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/35b3a3eb001ec8ff8c808ad6d990a583163ad365

tdf#80635 ww8import:1 take float table CENTER to inlined table

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 34 Commit Notification 2020-03-28 19:18:16 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cd868678583fa92833c37a63089131ba905dd3a6

tdf#80635 ww8import:2 take float table RIGHT to inlined table

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 35 Commit Notification 2020-03-30 07:38:52 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ba989a99ea19ffd0aafeea01f9b737ea79fa952a

tdf#80635 ww8import:3 take float table orient to inlined table

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 36 Timur 2020-03-30 11:02:12 UTC
Justin, congrats for all untangling, patches and tests.
While you already did a great work, I kindly ask you to comment on the following.

In bug 100676 file was password protected, but I added non-protected now, please see if that is this bug or (to me seems) not. I tested with patches 1 and 2 and looks as before fixes.
Comment 37 Justin L 2020-03-30 13:50:46 UTC
(In reply to Timur from comment #36)
> In bug 100676 file was password protected, but I added non-protected now,
> please see if that is this bug or (to me seems) not. 
Seems to have already been fixed in LO 5.3. Full reply in bug 100676.
Comment 38 Justin L 2020-04-22 14:22:37 UTC
*** Bug 76805 has been marked as a duplicate of this bug. ***