Header fields not tracking header values

LibreOffice 24.2.0.3 on Windows 10 64-bit

I’ve done a bunch of searching trying to figure out how to have a field in my header track the headings in my data, and I had set up some styles I thought would work, and nothing worked, so finally I made what I think is a basic file, using default styles, and it doesn’t work either, so now I’m wondering if I’ve been reading the wrong documentation, if the documentation is wrong or insufficient, or if there is a bug.

Below is the simple file, containing a header and a footer with the field for heading 9 content. Then there are some pairs of heading 9 styles and a default paragraph followed by a bunch of blanks. to get me to two pages.

The Heading seems to pick up the first instance (CAT) of the heading 9 content, but doesn’t switch to a later one on page 2. The footer also picks up the first instance (CAT) of the heading 9 content, but since there are two of them on page 2, and from my research, I thought it should display the last heading 9 content on page 1 (DOG). I thought the header of page 2 should have (DOG), and the foot of page 2 should have (GOPHER). But the CAT is everywhere!

So what basic feature have I misunderstood or isn’t working in this very simple file? While I’ve been using Writer for a while, this is the first attempt at using these fields and headers, and I’m stumped, in spite of finding lots of similar questions, and attempting to follow the similar answers in my more complex format, but now I see I don’t even understand how to get dynamic field values using the very most basic format.

$argh$.odt (10.7 KB)

The field displays the heading of the chapter, to which the first paragraph on the page belongs. On your page 2, the first (empty) paragraph is still in the “CAT” chapter.

To me, it looks like both CAT and DOG are on page 1 :question::question:

Hmm, I overlooked that - looked at the GOPHER. Yes, looks like a bug. Additionally it shows “up to level 8” in the field properties, instead of expected 9. Let me check, where it broke.

$argh$.odt (10.7 KB) This is the file edited in 7.6, with the header field made “up to level 9”, which fixes it.

A regression. Please file this as a bug. Thank you.

Thanks Mike, here’s the link to the bug report.

I don’t understand your explanaition, what does you mean “up to level 9”, and where is that shown? I guess you only fixed the header field, not the footer field (which is fine for demo purposes). So comparing the style:header and style:footer tags in the XML, I see the text:outline-level is different. Is that the simple cure? The file you sent shows the header properly and the footer improperly even in my version of LO.

And the reason I ask, is that with my more complex example using my own styles, I am generating my own XML, and I have text:outline-level=“9”. But on the other hand, maybe there is a different place I need to look for another level specifier?

Ah, but I was generating the actual headers with level 9, but borrowing the header/footer field definitions from manually created file containing the styles, and that only had level 8. Maybe I’m good to go.

Double-clicking the field shows this:

image

Sure - this is exactly what I wrote:

If that file was generated, then still it’s a regression, because version 7.6 allowed to edit that field, while in 24.2, editing and OK does not change the property.