tdf#104596 sw COMPAT layout: wrap in header for in-table flies
commite4635544b816d1ca27bd1ebba60f51444b0a898e
authorJustin Luth <justin.luth@collabora.com>
Thu, 16 Apr 2020 13:36:15 +0000 (16 16:36 +0300)
committerJustin Luth <justin_luth@sil.org>
Fri, 17 Jul 2020 17:49:05 +0000 (17 19:49 +0200)
treee4af3fb130255955973daaa6cf4d98a0ef5903fe
parentca2dfac3e790fb384e904502fe1ededd695001af
tdf#104596 sw COMPAT layout: wrap in header for in-table flies

You might have noticed that text in header/footers
will not wrap around fly frames, but just run underneath,
regardless of the wrap settings. Strange, eh?
[This is also true in footnotes.]

In an ancient effort to be compatible with MS strangeness,
OOo decided to do this as well for interoperability reasons.
http://openoffice.org/specs/writer/compatibility/adjust-text-wrapping.sxw

Apparently, flies in tables are exempt from that
rule in MSO, so this patch adds that exemption.

TABLE EXEMPTION IS AN EXPERIMENTAL ASSUMPTION
BASED ON VISUAL OBSERVATION FROM THIS BUG REPORT.
IT IS NOT BASED ON DOCUMENTATION.
I did look in DOC and DOCX manuals, and did a google
search, but found nothing.

A compat variable keeps older ODT files no-wrap,
so that we don't break layout of existing documents.
This variable is only read in the ODT import filter.
If it doesn't exist for ODT, it is set to false.
By default it is true, so it automatically is
enabled for anything that doesn't modify it in its
import filter, including all DOC/DOCX/RTF etc,
and newly created ODT documents.
In other words, allowing wrapping in the header for table-anchors
is the new default behaviour unless an import filter turns it off.

Headers/footers are the most common example. I also tested with
footnotes, and found that Word 2016 does wrap in that case as well,
even though the UI only allows AS_CHAR anchoring.

FYI: Allowing wrapping at ALL times
can be set with the Writer compatibility option
"Use OpenOffice.org 1.1 text wrapping around objects".

Change-Id: I9ad0c82df4af794079cce86fad9e401ea4575e59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92378
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
sw/inc/IDocumentSettingAccess.hxx
sw/qa/extras/odfexport/data/tdf104596_breakingExample.odt [new file with mode: 0644]
sw/qa/extras/odfexport/odfexport.cxx
sw/qa/extras/ww8export/data/tdf104596_wrapInHeaderTable.doc [new file with mode: 0644]
sw/qa/extras/ww8export/ww8export3.cxx
sw/source/core/doc/DocumentSettingManager.cxx
sw/source/core/inc/DocumentSettingManager.hxx
sw/source/core/text/txtfly.cxx
sw/source/filter/xml/xmlimp.cxx
sw/source/uibase/uno/SwXDocumentSettings.cxx