Bug 153222 - Manual Changes to Table of Contents Reset on Update Index or Update All
Summary: Manual Changes to Table of Contents Reset on Update Index or Update All
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: ARM Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-26 14:08 UTC by MissingEscapement
Modified: 2023-01-27 08:55 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample test document. (9.91 KB, application/vnd.oasis.opendocument.text)
2023-01-26 14:12 UTC, MissingEscapement
Details
Test file showing a minimal work around. (12.36 KB, application/vnd.oasis.opendocument.text)
2023-01-27 00:03 UTC, MissingEscapement
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MissingEscapement 2023-01-26 14:08:05 UTC
Description:
When I manually edit the Table of Contents, such as changing the background of a line/row or text then need to either Update Index or Update All, the changes are reverted to default.

Steps to Reproduce:
1. Insert a Table of Contents with the option, "Protected against manual changes," box checked and all other settings on default.
2. Make a few Heading entiries in the document.
3. Triple-click on a row of text to highlight it.
4. Change the Highlight Color to something else.
5. Right-click on the Table of Contents and select, "Update index." or use Tools>Update>Update All

Actual Results:
The Highlight Color reverts back to the default gray Field color.

Expected Results:
For the Highlight Color to remain.


Reproducible: Always


User Profile Reset: No

Additional Info:
This happens on a fresh installation of the latest release of Raspberry Pi OS 64-bit with LibreOffice and everything updated & upgraded via the default repositories.
Comment 1 MissingEscapement 2023-01-26 14:12:14 UTC
Created attachment 184933 [details]
Sample test document.

This is a sample test file, with one row heading of the TOC manually edited with yellow Highlight Color. Simply update the index or update all to see if the yellow row reverts to defauly Field gray.
Comment 2 MissingEscapement 2023-01-26 14:16:04 UTC
"Protected against manual changes," box UNchecked

Sorry, typo.
Comment 3 Stéphane Guillou (stragu) 2023-01-26 14:23:40 UTC
It is documented that refreshing the index will overwrite its direct formatting:

> "Manual changes that you make to an index are lost when the index is refreshed."

https://help.libreoffice.org/7.4/en-US/text/swriter/01/04120211.html

As I understand it, this isn't a bug, but pleas set back to "unconfirmed" if you test a supported version (7.4 or above) and see an issue.
Thank you!
Comment 4 MissingEscapement 2023-01-26 15:53:36 UTC
Thanks for the quick reply.

I was afraid it was a feature of some sort. I assume there's no setting to allow manual edits that remain after updating. I've been trying a workaround via styles, but have yet to get anywhere. I can get the, "Level," of each line set to a color via paragraph sytles, but that's for say all, "Level 1," TOC entries; when I need different colors for several Level 1 TOC entiries.

Thanks again.
Comment 5 Stéphane Guillou (stragu) 2023-01-26 21:06:02 UTC
In right-click > Edit index > Entries tab, you are able to style any element in the structure with character styles, including custom styles you have created.

As to formatting one element of one heading level with *different* styles that will persist, on a heading-by-heading basis, I think it's a very niche thing to do and I don't expect there will be interest in catering for it, unfortunately. The fact that the index is inherently structured means it needs to follow some consistent logic...

But maybe a question for ask.libreoffice.org, to potentially get more ideas from other users!
Thanks!
Comment 6 MissingEscapement 2023-01-27 00:02:11 UTC
Yes, that seems to be the case. I merely wished to match the color of chapters', top of the page, headers with their listings in the TOC. It makes for a more streamlined & user friendly book.

Thank you, for the suggestions!

Building upon styles, I was able to do a limited work around. I simply made new child paragraph styles under the Header 1 paragraph style. Each has a different Highlight color. I edited the index so that each test Level uses one of those new paragraph styles. When the TOC is updated each chapter listed has a different color. This works perfectly...except that there's only 10 levels and I need 100+ levels to make it work for a full book.

The setting, [Edit Index>Type>Create Index or Table of Contents>For: Entire Document>Evaluate up to level:_], will only go up to 10.
Comment 7 MissingEscapement 2023-01-27 00:03:52 UTC
Created attachment 184948 [details]
Test file showing a minimal work around.

Here is a copy of the test file with the work around I describe. The Test chapters listed in the TOC now match the page styles on the pages for each chapter.
Comment 8 Stéphane Guillou (stragu) 2023-01-27 08:55:20 UTC
Thanks for the example and limited workaround.
Maybe CC yourself to bug 153222, as that enhancement (if and when implemented) could help with keeping direct formatting while still being able to update page numbers.