Bug 149555 - Section header ignored (multiple headers + table of contents)
Summary: Section header ignored (multiple headers + table of contents)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.1 rc
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:24.2.0 target:7.6.1 target:7.5.6
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Header-Footer
  Show dependency treegraph
 
Reported: 2022-06-13 15:45 UTC by davidbasalla
Modified: 2023-10-23 11:16 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX with 2 headers, section break and table of contents (19.66 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-06-13 15:45 UTC, davidbasalla
Details

Note You need to log in before you can comment on or make changes to this bug.
Description davidbasalla 2022-06-13 15:45:11 UTC
Created attachment 180732 [details]
DOCX with 2 headers, section break and table of contents

In a document with 2 headers, under certain conditions the second header is ignored and replaced by the first header for all subsequent pages.

In the attached document, I have the following document:

- Page 1:
  - header with text (quite large height, 40% of page)
  - some text on the page
  - page break
  - section break (continuous)
- Page 2:
  - separate header with different text (small height)
  - table of contents
- Page 3:
  - same header as Page 2 
  - text
- Page 4:
  - same header as Page 2
  - text

If I open this doc in LibreOffice Writer 7.1.8.1 the headers look as expected.  With version 7.2.0.1 the header on page 2, 3 & 4 is incorrectly replaced by the header from page 1. (verified also with Windows Word and Apple Pages where this problem does not exist)

I've not been able to reduce the example document anymore so it appears to be a combination of multiple factors that cause this bug (page breaks, section break, multiple headers, table of of contents). Let me know if you require any more information!
Comment 1 Timur 2022-06-14 07:50:16 UTC
DOCX is MSO created.
Regression in 7.2. 4 pages and correct header went to 5 pages and wrong header.
 7ab349296dac79dad3fec09f60348efcbb9ea17e
author	Michael Stahl <Michael.Stahl@cib.de>	Fri Nov 20 2020 
sw: fix copying and deleting of section content via API

Michael, please see. Commit is not in other reports.
Comment 2 Commit Notification 2023-07-28 17:36:51 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0f39ecfed57f3f32d4f5cadf50b7dd9de77f8d7e

tdf#149555 sw: convert RANGE_IS_SECTION SwXTextRange if possible

It will be available in 24.2.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 3 Michael Stahl (allotropia) 2023-07-28 17:37:34 UTC
fixed on master
Comment 4 Commit Notification 2023-07-31 20:14:30 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/8d2c3ba78550631ae991bdd517b3acc9749e41b7

tdf#149555 sw: convert RANGE_IS_SECTION SwXTextRange if possible

It will be available in 7.6.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.
Comment 5 Commit Notification 2023-07-31 20:15:34 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/5f2c15fb652753fddf74c171abdf58295597366d

tdf#149555 sw: convert RANGE_IS_SECTION SwXTextRange if possible

It will be available in 7.5.6.

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 6 Commit Notification 2023-10-23 11:16:56 UTC
OmkarAcharekar committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/97b6b6b16c4b623f8a34393a906272439a7f0314

tdf#149555: sw_unocore: Add test for convert RANGE_IS_SECTION SwXTextRange

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