From The Document Foundation Wiki
- edit the table of contents to remove its protection:
- right click on the table of contents and select Edit index;
- on the Type tab, uncheck Protected against manual changes; and
- click OK.
- place the cursor at the beginning of the file or the section (if your cursor is on the Table of Contents, then the next step won’t work);
- press Alt+↵ Enter, release both keys, and press them again; and
- edit the table of contents again to protect it;