Bug 159201 - User-defined indexes don’t work anymore when created from styles
Summary: User-defined indexes don’t work anymore when created from styles
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2024-01-15 17:24 UTC by Olivier R.
Modified: 2024-01-29 16:25 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with headings and user-defined index (16.36 KB, application/vnd.oasis.opendocument.text)
2024-01-15 17:25 UTC, Olivier R.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier R. 2024-01-15 17:24:29 UTC
Description:
User-defined indexes created with Styles remained empty.

Regression.
Works with LO 7.5.

Steps to Reproduce:
1. Open a document with headings.
2. Create a User-defined index.
3. Select option “Create from” “Styles”
4. Click on “Assign Styles” and select headings that are present in the document.

Actual Results:
Empty index.

Expected Results:
Selected headings should be visible in the index.


Reproducible: Always


User Profile Reset: No

Additional Info:
Here is a document where I created a user-defined index at the end.
If you open it with LO 7.6, you’ll see no entries in the index.
If you open it with LO 7.5, you’ll see no entries in the index, but if you right-click on it and update it, entries will appear.
Comment 1 Olivier R. 2024-01-15 17:25:22 UTC
Created attachment 191961 [details]
Document with headings and user-defined index
Comment 2 m_a_riosv 2024-01-15 21:25:57 UTC
With Menu/Tools/Updates/Update all, shows the TOC.
Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
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
Comment 3 Olivier R. 2024-01-16 08:33:11 UTC
The bug occurs on Windows. I didn’t test it on another OS.

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 4 m_a_riosv 2024-01-16 10:54:19 UTC
Please test in safe mode, Menu/Help/Restart in Safe Mode
Comment 5 Olivier R. 2024-01-16 11:39:47 UTC
This is confusing.

If I create an user-defined index with Styles, it’s empty.
But if I close the document and reload it, then update the created index, the entries appear.

The behavior is the same in safe mode and in normal mode.
Comment 6 Buovjaga 2024-01-26 14:55:49 UTC
Bibisected with linux-64-7.6 to 5c04c4474236cc50009aea6d89f7c443c861af19
tdf#40142 - Consider level settings of the various text nodes

I tested by reproducing from scratch. Not with the attached file.
Comment 7 Andreas Heinisch 2024-01-26 16:04:00 UTC
Did you create the user indexes with the correct level? I don't know if the fix of the bug 40142 creates more confusion then it fixed in the first place.
Comment 8 Buovjaga 2024-01-26 16:13:36 UTC
(In reply to Andreas Heinisch from comment #7)
> Did you create the user indexes with the correct level? I don't know if the
> fix of the bug 40142 creates more confusion then it fixed in the first place.

I picked 1 for Heading 1 and 2 for Heading 2. Did I do it correctly?
Comment 9 Andreas Heinisch 2024-01-29 15:54:31 UTC
Investigated the problem. I added the check in [1] and if I try to create an index from scratch the loop continues in [2] and doesn't create the index.



[1] https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/doctxm.cxx?r=ae7807c8#1380
[2] https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/doctxm.cxx?r=ae7807c8#1365
Comment 10 Andreas Heinisch 2024-01-29 16:24:50 UTC Comment hidden (off-topic)
Comment 11 Andreas Heinisch 2024-01-29 16:25:44 UTC Comment hidden (off-topic)