Bug 94801 - Fileopen DOCX: Text in table different width in Writer (multiple lines) and Word (single line) for Microsoft fonts - 0,1cm difference
Summary: Fileopen DOCX: Text in table different width in Writer (multiple lines) and W...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: high normal
Assignee: László Németh
URL:
Whiteboard: target:6.5.0
Keywords: filter:docx, notBibisectable
: 96325 130124 (view as bug list)
Depends on:
Blocks: DOCX-Tables
  Show dependency treegraph
 
Reported: 2015-10-05 19:38 UTC by Timur
Modified: 2023-06-14 19:38 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
Text in table as open in MSO, LO from DOC, LO from DOCX (69.18 KB, image/jpeg)
2015-10-05 19:38 UTC, Timur
Details
Text in table from DOCX (16.81 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-10-05 19:39 UTC, Timur
Details
Text in table from DOC (28.50 KB, application/vnd.ms-word)
2015-10-05 19:39 UTC, Timur
Details
Annual Report - page 7 - tables (28.65 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-10-05 19:42 UTC, Timur
Details
scnreen shot MsO2010 table properties (42.95 KB, image/png)
2015-10-06 13:59 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2015-10-05 19:38:28 UTC
Created attachment 119322 [details]
Text in table as open in MSO, LO from DOC, LO from DOCX

Text in table is different in Writer, which shows multiple lines where Word shows a single line. As shown in the attached screenshot, it's the same for import from doc or docx.
Comment 1 Timur 2015-10-05 19:39:17 UTC
Created attachment 119323 [details]
Text in table from DOCX
Comment 2 Timur 2015-10-05 19:39:35 UTC
Created attachment 119324 [details]
Text in table from DOC
Comment 3 Timur 2015-10-05 19:42:28 UTC
Created attachment 119325 [details]
Annual Report - page 7 - tables

Similar problem is in Bug 77417 with http://www.microsoft.com/investor/reports/ar13/docs/2013_Annual_Report.docx. I extracted only page 7 for an example. That page doesn't fit on a single page in LO, because text in table cannot fit.
Comment 4 Cor Nouws 2015-10-06 13:19:15 UTC
Thanks for the report Timur.

I confirm the problem.
Possibly distance text to border (table property) is involved ?

I see the same problem in LO 3.3.0 - so some basic difference in interpretation of such a lay out??
Comment 5 Cor Nouws 2015-10-06 13:59:07 UTC
Created attachment 119357 [details]
scnreen shot MsO2010 table properties

In MsO you can set AutomaticallyResizeToContents .. but unchecking that doesn't make the formatting change in MsOffice, nor in LibreOffice - so looks not as the cause of the difference
Comment 6 Cor Nouws 2015-10-06 13:59:50 UTC
(In reply to Timur from comment #3)

> I extracted only page 7 for an example. That page doesn't fit on a single
> page in LO, because text in table cannot fit.

There is a whole bunch of tabs and spaces in many cells there - I doubt if it's the same issue...
Comment 7 Cor Nouws 2015-10-06 14:08:30 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2016-02-16 09:12:36 UTC
*** Bug 96325 has been marked as a duplicate of this bug. ***
Comment 9 Timur 2016-07-29 07:38:39 UTC
Possible example in "Secteur d’activité de l’organisme" section in attachment 123358 [details] from Bug 98480.
Comment 10 Timur 2016-11-08 12:08:07 UTC
Another example is with attachment 127229 [details] from Bug 102012. Apart from frame problem, it has fit to column issue in all versions.
Comment 11 Timur 2017-01-30 17:58:25 UTC
Possible example in attachment 90934 [details] from Bug 72837 with "Форма по ОКУД" that goes to the next line.
Comment 12 Timur 2018-07-26 11:44:48 UTC
Another possible example is in attachment 118489 [details] from 93977.
TOC there is manually created but for this bug it's relevant that some entries in Writer do not fit to a single line. Font is Arial. 
Examples are on 2nd page: "A-Memos and Memos to Board Offices and Other County Departments (continued)", "Other County Departments...", "A-Memo E-Mail Response to Constituent.." and "Envelope with Agenda Date..". 

In attachment 90934 [details] from Bug 72837 font is Cambria. 
In attachment 127229 [details] from Bug 102012 font is Calibri. 
In attachment 123358 [details] from Bug 98480 font is Calibri.
In attachment 121124 [details] from Bug 96325 font is Arial.
In attachment 119323 [details] from this Bug 94801 font is Arial.

I guess it's safe to change the title to point out to Microsoft fonts.
Comment 13 Timur 2018-10-16 16:11:28 UTC
*** Bug 119186 has been marked as a duplicate of this bug. ***
Comment 14 Timur 2019-10-11 06:43:28 UTC
We may also have an opposite example. 
If attachment 133073 [details] ODT with 3 rows in footer (font Arial) is saved in LO as DOC, that DOC opened both in LO and MSO shows 5 rows in footer.
Comment 15 Commit Notification 2020-01-15 21:28:00 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/62d084d50c0e6c90918f687251ffbb15264d7317

tdf#94801 DOCX import: fix table width loss by rounding

It will be available in 6.5.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 16 Timur 2020-01-17 12:30:50 UTC
Verified for DOCX attachment 119323 [details] from this bug 94801.
DOCX attachment 127229 [details] from Bug 102012 (that also has frame position issue) verified for text in cells.

No change for DOCX attachment 119325 [details] from this bug 94801 (could be another issue with tabs). A table.
DOCX attachment 123358 [details] from Bug 98480 (multiple issues) no change for "Secteur d’activité de l’organisme" and following spaces on 1st page. Not a table.
DOCX attachment 90934 [details] from Bug 72837 (that was compared as attachment 90935 [details]) no change for "Форма по ОКУД" position. Not a table.

Not fully resolved for DOC attachment 119324 [details] from this bug 94801 (first row "Akušersko-ginekološka sestra - tehničar"). A table.
DOC attachment 121124 [details] from duplicated bug 96325 (that was compared attachment 122632 [details]) no change for "Emon EMS-koodi / Mors EMS kod" and "FIFen minimimitat näyttelyhäkeille 50x50x50 cm". A table.
DOC attachment 118489 [details] from bug 93977 no change for "A-Memos and Memos to Board Offices and Other County Departments (continued)". Not a table.
DOC attachment 52268 [details] from Bug 119186 (that was compared as attachment 144074 [details]) no change for "Sort code" and "Sterling account..". A table.
An opposite filesave example for ODT attachment 133073 [details] from bug 107628 remains. Not a table.

László, thank you very much for this fix (DOCX import of table). I know how users were perplexed for this (even if seemingly not a big issue). 
I may reopen other DOCX examples, that were not resolved. I wish you commented on those with table.
I guess I should I reopen bugs for DOC. Please see if you could take at least one of those with table, so that it's clear if we have real duplicates.
Comment 17 László Németh 2020-01-20 10:19:57 UTC
Timur: thanks for your kind words and detailed feedback! Thanks to Mike Kaganski and Caolán McNamara, the unnecessary integer optimization of the new floating point twip->100th mm conversion function of my fix was removed by them a few days ago, fixing an export issue. Maybe the remaining import issues were solved partially, too. But the final solution will be using more precise calculation in Writer core (or better, the same precision with the same rounding errors, as in MSO :).

I ask you to open a new issue for the DOC problems or reuse and reopen a duplicate of this issue, limiting this one only for DOCX. This would help our work the most. Maybe we have found a new DOCX issue here, but we will report that in a new issue, if it's really exist, or it's not a duplicate of the other DOCX problems, that you listed in your comment. Thanks for it, we are working on DOCX table issues, so your list will help to fix as much, as it's possible.
Comment 18 László Németh 2020-01-22 18:53:57 UTC
*** Bug 130124 has been marked as a duplicate of this bug. ***
Comment 19 László Németh 2020-01-22 18:56:49 UTC
@Caolán, Mike, Timur: Fix of my patch fixed the import of the test document of Bug 130124, so that is not only an export fix really.
Comment 20 Timur 2020-01-24 12:46:17 UTC
Although it's seen from See Also, let me say that  DOCX attachment 119325 [details] was resolved in original bug 77417.
A separate bug 130087 is for DOC case with the table, that was resolved here for DOCX. 
Bug 130088 is for simple text, not a table.