Bug 123917 - Wrong chapter in header's Chapter field when a page starts with a section's endnotes
Summary: Wrong chapter in header's Chapter field when a page starts with a section's e...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) rc
Hardware: All All
: medium normal
Assignee: Not Assigned
: 127264 (view as bug list)
Depends on:
Blocks: Writer-Header-Footer Fields
  Show dependency treegraph
Reported: 2019-03-07 07:25 UTC by Mike Kaganski
Modified: 2022-07-28 03:39 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

A sample with endnotes at the section's end and wrong chapter field (28.84 KB, application/vnd.oasis.opendocument.text)
2019-03-07 07:25 UTC, Mike Kaganski

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2019-03-07 07:25:44 UTC
Created attachment 149780 [details]
A sample with endnotes at the section's end and wrong chapter field

When a chapter is enclosed into a section, *and* the section has endnotes collected at the end of that section, *and* the endnotes flow to a new page, *and* that new page has a header with Chapter field in it, then the Chapter field on that page which is started with a section's endnotes shows wrong chapter information.

Steps to reproduce:

1. Create a new text document.
2. Add a header to the used page style (i.e., "Default Style" in pristine configuration).
3. Add Chapter field to the header, displaying Chapter Name of level 1.
4. In the page body, type "FirstHeading" and apply Heading 1 paragraph style.
5. Add some chapter text.
6. Add a new paragraph with text "SecondHeading" and Heading 1 style.
7. Add second chapter text enough to see that it flows to a next page, and it's clear that the next page's header shows "SecondHeading" in the Chapter field.
8. Select "SecondHeading" and the following chapter, and add a section; in the section properties, make sure to collect endnotes at the end of section.
9. Add some endnotes to the second chapter text (now in section), so that endnotes (also in that section) start to flow to a new page.

Expected: the new page starting with the rest of second chapter's endnotes should have "SecondHeading" in the header.

Actual: that page has "FirstHeading" in the header.

See: https://ask.libreoffice.org/en/question/182657
Comment 1 Dieter 2019-05-15 06:22:08 UTC
I confirm it with the provided document. I also deleted field in header ad added it again - same result

Version: (x64)
Build ID: e92dcfdc7bd7b237e0bee26ff226a102d9e8e766
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-05-14_00:00:57
Locale: en-US (de_DE); UI-Language: en-US
Calc: threaded
Comment 2 Mike Kaganski 2019-09-01 13:58:23 UTC
*** Bug 127264 has been marked as a duplicate of this bug. ***
Comment 3 ajlittoz 2019-09-01 15:23:33 UTC
The *Heading 1* doesn't need to be enclosed in the section. The structure:

Heading 1
-- start of section
  section contents without *Heading n*
-- end of section

also exhibits the bug.
Comment 4 ajlittoz 2019-09-01 17:15:53 UTC
User AJB49 mentions the bug already exists in LO 4.1.6. So, this is a long standing bug.
Comment 5 Kartik Subbarao 2020-07-27 20:37:16 UTC
In 2014, I spent a lot of time tracking down the cause of this problem and posted a detailed analysis:


Unfortunately, I haven't seen any responses since then. The workaround I'm using is cumbersome. I end up extracting individual pages from the PDF files, manually fixing the incorrect headers, and then concatenating the correct pages back together.
Comment 6 QA Administrators 2022-07-28 03:39:11 UTC
Dear Mike Kaganski,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team