Bug 162195 - TOC in Master document include headings from hidden sections
Summary: TOC in Master document include headings from hidden sections
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.4
Keywords: bibisected, bisected, regression
: 163435 (view as bug list)
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2024-07-25 14:56 UTC by Olivier Hallot
Modified: 2024-11-25 09:26 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Master document (4.64 MB, application/vnd.oasis.opendocument.text-master)
2024-07-25 14:57 UTC, Olivier Hallot
Details
Chapter document (443.51 KB, application/vnd.oasis.opendocument.text)
2024-07-25 14:58 UTC, Olivier Hallot
Details
Chapter document (443.53 KB, application/vnd.oasis.opendocument.text)
2024-07-25 14:59 UTC, Olivier Hallot
Details
Sample with two section, one visible, one hidden. (13.23 KB, application/vnd.oasis.opendocument.text)
2024-07-25 18:46 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Hallot 2024-07-25 14:56:32 UTC
Description:
The Table of Contents in a master document includes entries from hidden sections in chapters.

Steps to Reproduce:
1.Place the attached master document and chapter document in a folder
2.Open the master document, update the TOC.
3.

Actual Results:
The TOC in master includes the entry "Copyright – I am supposed to be hidden on master TOC" just below the Preface entry. 

This section is hidden in master document because the section visibility is controlled by variable "book eq 1" in the caper "Preface"

The section is actualy invisible but the the Heading "Copyright – I am supposed to be hidden on master TOC" is brought to the master TOC.

Expected Results:
The headings in the hidden sections shall not be listed in the master TOC.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (pt_BR.UTF-8); UI: en-US
Calc: default
Comment 1 Olivier Hallot 2024-07-25 14:57:56 UTC
Created attachment 195502 [details]
Master document
Comment 2 Olivier Hallot 2024-07-25 14:58:15 UTC
Created attachment 195503 [details]
Chapter document
Comment 3 Olivier Hallot 2024-07-25 14:59:27 UTC
Created attachment 195504 [details]
Chapter document
Comment 4 m_a_riosv 2024-07-25 18:46:52 UTC
Created attachment 195519 [details]
Sample with two section, one visible, one hidden.

Seems it happens also with no master.

Reproducible
Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c60dd66d89dab2174aa71c26c653f68908c7ba78
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 5 B. Antonio Fernández 2024-07-26 16:28:49 UTC
Reproducible always

And also:
 When you insert the variable book (1) in the chapter document. to hidde the sectión 

The previous paragraph to the hidden section adquires the atributes of the first paragraph of the hidden section. No way to delete this format. 

Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: es-ES
Calc: CL threaded
Comment 6 B. Antonio Fernández 2024-07-27 23:17:57 UTC
Reproducible always

And also:
 When you insert the variable book (1) in the chapter document. to hidde the sectión 

The previous paragraph to the hidden section adquires the atributes of the first paragraph of the hidden section. No way to delete this format. 

Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: es-ES
Calc: CL threaded

____________________________________________________________

The bug is present in version 7.6.8.0 and in all versions 24

In version 7.6.7.2 and earlier, hidden section headers are not displayed in the index.
Comment 7 Buovjaga 2024-11-22 15:27:53 UTC
*** Bug 163435 has been marked as a duplicate of this bug. ***
Comment 8 Buovjaga 2024-11-22 15:38:02 UTC
Bibisected based on comment 4 with linux-64-24.2 to ff7f1b59e22092d8548459e75fe912db852f056f
tdf#159565 prerequisite: make hidden sections have zero-height frames

(original commit 0c96119895b347f8eb5bb89f393351bd3c02b9f1 backported to 24.2)

Dear all: do remember to add a bibisectRequest :)
Comment 9 Mike Kaganski 2024-11-23 06:18:18 UTC
https://gerrit.libreoffice.org/c/core/+/177079
Comment 10 Commit Notification 2024-11-23 08:51:39 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6e828489da09ce4bf96e255e496510d37833f33e

tdf#162195: use SwFrame::IsHiddenNow when building index

It will be available in 25.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 11 Commit Notification 2024-11-25 09:26:02 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/a5edc358b158ec017f26ab83ca42e0af31ce0147

tdf#162195: use SwFrame::IsHiddenNow when building index

It will be available in 24.8.4.

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.