Bug 159678 - heading fields in headers and footers do not track heading content through the document
Summary: heading fields in headers and footers do not track heading content through th...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Baole Fang
URL:
Whiteboard: target:24.8.0 target:24.2.1.2
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2024-02-11 07:15 UTC by guruglenn
Modified: 2024-02-21 08:42 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
basic document to demonstrate bug. (10.67 KB, application/vnd.oasis.opendocument.text)
2024-02-11 07:15 UTC, guruglenn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description guruglenn 2024-02-11 07:15:09 UTC
Created attachment 192503 [details]
basic document to demonstrate bug.

Based on the recommendation at the link, this seems to be a regression bug.
https://ask.libreoffice.org/t/header-fields-not-tracking-header-values/101951/2
At the above link, the claim is made by mikekaganski that this was working in version 7.6. I appreciate his help.

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.
Comment 1 Mike Kaganski 2024-02-11 15:33:15 UTC
To reproduce from scratch:

1. Create a new text document;
2. Insert->Field->More Fields->Document->Heading (Heading contents), select "Up to level": 9, press [Insert], then [Close];
3. In Navigator, right-click the field, choose Edit, and inspect the "Up to level" value.

In 7.6.0.3, it's 9.
In 23.2.0.3 (and in current master), it's 8.

Suspecting something related to the replacement of "Up to level"'s spin button with drop-down list.
Comment 2 Mike Kaganski 2024-02-11 15:55:43 UTC
Regression after commit 27fde46937ecb71e7ce738cba430119a79cea77f.
Comment 3 Baole Fang 2024-02-15 00:49:46 UTC
Sorry, start fixing it now.
Comment 4 Mike Kaganski 2024-02-15 02:59:53 UTC
(In reply to Baole Fang from comment #3)

Thanks, and please don't be sorry. The collective wisdom in the project is "there is no improvement without a regression" ;) - which is ~expected, given the size of the codebase, its complexity and interconnections.
Comment 5 guruglenn 2024-02-15 17:15:30 UTC
That's a very nice way to put it, Mike, a former co-worker used to put it this way:   New bugs for old!
Comment 6 Baole Fang 2024-02-15 23:57:50 UTC
:)
Comment 7 Commit Notification 2024-02-16 04:13:31 UTC
Baole Fang committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/694b9b6422ee27da13ad455174cde50b1a673ac7

tdf#159678: Fix heading dropdown list

It will be available in 24.8.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2024-02-20 21:14:01 UTC
Baole Fang committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/9d48831793cdbf93975b71083fbcc9577c17fceb

tdf#159678: Fix heading dropdown list

It will be available in 24.2.2.

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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2024-02-21 08:42:12 UTC
Baole Fang committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-1":

https://git.libreoffice.org/core/commit/613135cef0b6b2cc9d01d9a7126fb6707fd473f0

tdf#159678: Fix heading dropdown list

It will be available in 24.2.1.

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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

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