We create an .docx document with apache poi and convert it to PDF with jodconverter (wich requires LibreOffice). The TOC (table of contents) was updated in previous versions by adding "<w:fldSimple w:instr="TOC \o "1-3" \h" w:dirty="true"/>" when you opened the generated .docx file. MS-Word and Google-Docs are still able to recognize it, but LibreOffice does not detect the instruction to create the TOC automatically. Also the "Update Index/Indices" does not appear on right-click.
When I add a TOC by hand in the opened .docx in LibreOffice, everything works fine.
It was tested with MacOS-bigSur(11.2) and MS-Windows-10.
Unfortunately i cannot attach the example files here.
The "<w:fldSimple w:instr="TOC \o "1-3" \h" w:dirty="true"/>" is not recognized by LibreOffice and sometimes leads to lacking UI.
The TOC is automatically created and recognized in LibreOffice. The "Update Index/Indices" can be executed on right-click or triggered programmatically.
User Profile Reset: No
Works with MS-Word and Google-Docs, just "Update Indexes" is required. The TOC instruction is recognized and applied.
Created attachment 169797 [details]
generated docx with poi and jodconverter
Created attachment 169798 [details]
generated docx uploaded saved and downloaded with google docs
Created attachment 169799 [details]
generated docx openened and saved with MS-Word
Created attachment 169800 [details]
generated docx opened updated indices and saved with MS-Word
Created attachment 169824 [details]
Attachment #169797 [details] in Writer 7.0 and 6.4
In 6.4 an empty TOC was imported, which could be updated (although this did not happen automatically, like in Word).
In 7.0 this is missing since:
author Mike Kaganski <firstname.lastname@example.org> 2019-12-13 09:36:39 +0300
committer Mike Kaganski <email@example.com> 2019-12-16 17:23:57 +0100
tdf#129353, tdf#129402: fix node creation on index import
Adding CC to: Mike Kaganski
For the record: attachment 169797 [details], when opened in Word 2016, asks if one wants to refresh "fields that may refer to other files". Or rejected, the result looks absolutely identical to what LibreOffice shows after the patch mentioned in comment 5. I actually doubt that this is a regression, since under no conditions Word shows the result that we had prior to that. What we miss is handling of the 'dirty' attribute, which we always lacked.