Files
odfstudio/include
Michael Stahl de4a472a86 sw,xmloff: DOCX: improve Word page margin compatibility
The problem with not having some but not all headers enabled on a page
style is that Word does page margins differently than Writer, and this
causes `testTdf116486` and `testFdo44176` to fail.

In Writer, it's always additive: page `fo:margin-top` + header
`fo:margin-bottom` gives the spacing from the top of the page to the
body text.

In Word, there is a `w:header` (from top of page to header) and `w:top`
(from top of page to body text) and the problem is, they're not
additive, both are measured from top of page.

If all headers are enabled,
`SectionPropertyMap::PrepareHeaderFooterProperties()` can map this to
`HeaderHeight` and `HeaderBodyDistance` properties, but of course those
won't be used if there's no header on the page.

So import `w:top` as a new property "MinTopBodyDistance" (and also
"MinBottomBodyDistance") implemented as new item
`RES_FRMATR_PAGE_MIN_TOP` (and also `RES_FRMATR_PAGE_MIN_BOTTOM`).

Use it in `SwLayoutFrame::Format()` to set the page frame margins, but
only if there is no header; else rely on the existing header properties.

Export this to ODF as
`coext:min-page-margin-top` and `coext:min-page-margin-bottom`.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I9d98bbf7138c9ef04d4ab1ddcb4c3183a12d9b11
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4310
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e065ba01c029cd01c9128afccdc953e2e3a49e65)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206702
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-18 12:17:15 +02:00
..
2026-05-22 09:32:38 +02:00
2026-02-18 13:44:22 +01:00
2026-04-30 08:54:45 +02:00
2026-06-04 10:00:29 +02:00
2026-06-04 10:00:29 +02:00
2026-04-30 08:54:45 +02:00
2026-06-09 14:49:09 +02:00
2026-04-30 08:54:45 +02:00
2026-06-16 01:20:43 +02:00
2026-06-16 01:20:43 +02:00
2026-06-11 08:58:23 +02:00
2026-05-22 09:32:38 +02:00
…
…
…
…
…