Bug 119760 - FILEOPEN DOCX: Left table border overlaps text (no table-level borders defined)
Summary: FILEOPEN DOCX: Left table border overlaps text (no table-level borders defined)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.2.0
Keywords: filter:docx
Depends on:
Blocks: DOCX-Tables Table-Borders
  Show dependency treegraph
 
Reported: 2018-09-08 14:58 UTC by Justin L
Modified: 2018-10-01 10:47 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
overlapBorder.docx: just open in LO to see the text overlap the border (10.14 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-09-08 14:58 UTC, Justin L
Details
table-cell-marginB.docx: table cell A1 DOES determine table position (left only). (10.56 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-09-10 11:46 UTC, Justin L
Details
table-cell-marginC.docx: test showing how table borders / cell borders affect position (12.84 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-09-25 14:04 UTC, Justin L
Details
PDF from word 2016 - last row seems to determine table position. (95.76 KB, application/pdf)
2018-09-25 14:11 UTC, Justin L
Details
PDF from word 2003 - first row seems to determine table position. (19.07 KB, application/pdf)
2018-09-25 14:13 UTC, Justin L
Details
overlapBorder_withTblBorders3Row.docx: example document where different MSWord versions look very differently. (11.97 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-09-26 11:49 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2018-09-08 14:58:46 UTC
Created attachment 144752 [details]
overlapBorder.docx: just open in LO to see the text overlap the border

In this exaggerated example, the text really overlaps the border. In Word, it doesn't overlap.  (A side note is that Word has a maximum border width, while LO keeps growing, but that isn't the cause of this overlap, since it also happens at non-maximum border-widths.)

Bibisect-43all suggests this is inherited from OOo, and various spot checks indicate that it has never worked.

I ran into this when trying to remove the document.xml's tblBorders.
Comment 1 Dieter Praas 2018-09-09 20:57:08 UTC
I confirm it with

Version: 6.0.6.2 (x64)
Build-ID: 0c292870b25a325b5ed35f6b45599d2ea4458e77
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group
Comment 2 Justin L 2018-09-10 11:46:15 UTC
Created attachment 144771 [details]
table-cell-marginB.docx: table cell A1 DOES determine table position (left only).

Modified version of the proof unit test in ooxmlexport10.cxx
Comment 3 Justin L 2018-09-25 14:04:05 UTC
Created attachment 145163 [details]
table-cell-marginC.docx: test showing how table borders / cell borders affect position

(In reply to Justin L from comment #2)
> table-cell-marginB.docx: table cell A1 DOES determine table position
That might be true in Writer, but in Word it is the last row that determines the column position. (This is getting really ugly, because export also seems to be based on cell A1.)
Comment 4 Justin L 2018-09-25 14:11:22 UTC
Created attachment 145164 [details]
PDF from word 2016 - last row seems to determine table position.
Comment 5 Justin L 2018-09-25 14:13:14 UTC
Created attachment 145165 [details]
PDF from word 2003 - first row seems to determine table position.

Even worse - MS isn't consistent in this...
Comment 6 Justin L 2018-09-26 11:45:07 UTC
proposed fix at https://gerrit.libreoffice.org/60989 tdf#92026 docxexport: eliminate fake tblBorders
Comment 7 Justin L 2018-09-26 11:49:17 UTC
Created attachment 145181 [details]
overlapBorder_withTblBorders3Row.docx: example document where different MSWord versions look very differently.

This example document was just added to show the complexity in working in this area. LO opens it like the modern MSO 2016, which is fine.
Comment 8 Commit Notification 2018-09-28 03:53:06 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#119760 writerfilter: cell border priority over tblBorder

It will be available in 6.2.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 9 BogdanB 2018-10-01 10:47:37 UTC
it works on 6.2

Version: 6.2.0.0.alpha0+
Build ID: a906b68a9fff30c2af5c03189e59c1952cd3f69f
CPU threads: 4; OS: Linux 4.15; UI render: GL; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2018-09-30_19:07:59
Locale: ro-RO (ro_RO.UTF-8); Calc: threaded