tdf#119760 docx: table starts at left, not mid-border
commitd2db4bc9507653a46fdea282d41b9683910a072f
authorJustin Luth <justin.luth@collabora.com>
Thu, 2 Apr 2020 07:22:45 +0000 (2 10:22 +0300)
committerMiklos Vajna <vmiklos@collabora.com>
Tue, 7 Apr 2020 09:29:27 +0000 (7 11:29 +0200)
treead926d7198edac7c8c0d5068e7b5fd0eca0c180e
parenta7f36ba45bf86ccd8f8a61c27f5b25d0999176b1
tdf#119760 docx: table starts at left, not mid-border

related to compatibilityMode = 15; the new export default.

In Word 2013+, it appears that the table starts immediately,
and then the border is added. In Writer, the table is
considered to start mid-border. So that difference needs
to be emulated by adjusting the table margin.
The same appears to be true for nested tables.
Negative margins appear to just be ignored for nested tables,
and Word's UI does not accept a negative value.

I modified the existing table-position-15.docx slightly (in Word 2016),
just to remove spacing between the caption and the table
so that it would be easy to visually compare the table position.
One slight difference is that WORD seems to add a small "margin"
to the the paragraph shading area - don't let that throw you off.

The existing unit test enforced settings that didn't match
how Word 2013 was showing the files, despite being written to
test exactly that. I assume the author was focusing more on
OLDER versions of Word and didn't care too much about the
NEW version. A man after my own heart.

MISC:
-I removed my earlier TODO which was just plain wrong.
-the ambiguous make::any caused me untold problems,
so I made it unambiguous by moving it into a variable.

Change-Id: I0685ab74777f1def2841c7d18ff1cdaf2753f47b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91608
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
sw/qa/extras/ooxmlexport/data/table-position-15.docx
sw/qa/extras/ooxmlexport/data/tdf119760_tableInTablePosition.docx [new file with mode: 0644]
sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
sw/source/filter/ww8/docxattributeoutput.cxx
writerfilter/source/dmapper/DomainMapperTableHandler.cxx