Bug 135338 - Starting document with Left Page style doesn't use "first" header/footer.
Summary: Starting document with Left Page style doesn't use "first" header/footer.
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium trivial
Assignee: Justin L
Whiteboard: target:7.1.0
Depends on:
Reported: 2020-07-31 10:29 UTC by Justin L
Modified: 2020-08-18 05:22 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

firstWhen.odt: Initial page uses the normal left footer, not the first page footer. (10.54 KB, application/vnd.oasis.opendocument.text)
2020-07-31 10:29 UTC, Justin L

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2020-07-31 10:29:17 UTC
Created attachment 163802 [details]
firstWhen.odt: Initial page uses the normal left footer, not the first page footer.

When using the alternating Left/Right page styles, each page always uses the "first" headers and footers. That's fine. But if (strangely) you BEGIN the document with the left page style (i.e. start with page 2), that page shows the "Left" h/f instead of "FirstLeft".

This has always been the case AFAICS. However, it works for "Right Page".

Support for the first h/f seemed to arrive in LO 6.0 with
commit bff8cd3d52223002263dcb8c09758c4fc753b6e3
Author: Luke Deller on Wed Jul 12 23:56:50 2017 +1000
    tdf#109080 First page header/footer ODF (1/2)
    The proposal to add <style:header-first> / <style:footer-first>
    to the ODF standard has not yet been accepted, so meanwhile we
    should be using an extension namespace for these elements.
    This first commit (intended for backport) adds support for reading
    <loext:header-first> / <loext:footer-first>

This is a trivial problem. I only note it because it doesn't export to DOCX that way, so there is an inconsistency. The DOCX version ends up being the way I would expect it to be (always showing the first h/f, even on the first page). If any page was to show the "first" h/f, I would expect it to be the first page in the document.

VERY IMPORTANT: The UI for a left-page-only style doesn't allow you to change the settings to allow for a separate first page. (But that can be worked around by temporarily changing the style to be for right and left.) However, if separate ones are defined, it does honour that. So the difficulty in making this kind of problematic document makes this odd behaviour even less important.

Steps to reproduce
1.) just open firstWhen.odt.

Notice that the initial page has the footer is "left/even". Now look at the rest of the pages. They all start with the "first" footer for their page style.

So why is the first use of Left Page different from the other times? 
Hmm. sw/source/core/layout/newfrm.cxx::Init
    // Create a page and put it in the layout
    // The first page is always a right-page and always a first-page
Comment 1 Justin L 2020-07-31 10:48:21 UTC
proposed fix at https://gerrit.libreoffice.org/c/core/+/99862
Comment 2 Commit Notification 2020-08-17 18:53:23 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":


tdf#135338 sw layout: show FirstLeft on very first left page style.

It will be available in 7.1.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:

Affected users are encouraged to test the fix and report feedback.