Bug 123917

Summary: Wrong chapter in header's Chapter field when a page starts with a section's endnotes
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: page74010-sf
Priority: medium    
Version: 6.2.1.1 rc   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 48741, 107739    
Attachments: A sample with endnotes at the section's end and wrong chapter field

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: 6.3.0.0.alpha1+ (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*
  endnotes
-- 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:

https://bugs.documentfoundation.org/show_bug.cgi?id=81012#c6

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 Comment hidden (obsolete)
Comment 7 Mike Kaganski 2024-04-04 07:33:33 UTC

*** This bug has been marked as a duplicate of bug 81012 ***