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.
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.
"Protected against manual changes," box UNchecked Sorry, typo.
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!
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.
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!
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.
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.
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.