Bug 140461 - Libreoffice 7.1.0.3 cannot handle "<w:fldSimple w:instr="TOC \o "1-3" \h" w:dirty="true"/>" to create Table of Contents automatically anymore
Summary: Libreoffice 7.1.0.3 cannot handle "<w:fldSimple w:instr="TOC \o "1-3" \h" w:d...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-TableofContents MSO-External-Producers
  Show dependency treegraph
 
Reported: 2021-02-17 06:22 UTC by Heiko
Modified: 2023-03-29 17:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
generated docx with poi and jodconverter (13.11 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-17 06:24 UTC, Heiko
Details
generated docx uploaded saved and downloaded with google docs (10.66 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-17 06:26 UTC, Heiko
Details
generated docx openened and saved with MS-Word (15.99 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-17 06:26 UTC, Heiko
Details
generated docx opened updated indices and saved with MS-Word (16.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-17 06:27 UTC, Heiko
Details
Attachment #169797 in Writer 7.0 and 6.4 (200.57 KB, image/png)
2021-02-17 14:17 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko 2021-02-17 06:22:54 UTC
Description:
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.

Actual Results:
The "<w:fldSimple w:instr="TOC \o "1-3" \h" w:dirty="true"/>" is not recognized by  LibreOffice and sometimes leads to lacking UI.

Expected Results:
The TOC is automatically created and recognized in LibreOffice. The "Update Index/Indices" can be executed on right-click or triggered programmatically.


Reproducible: Always


User Profile Reset: No



Additional Info:
Works with MS-Word and Google-Docs, just "Update Indexes" is required. The TOC instruction is recognized and applied.
Comment 1 Heiko 2021-02-17 06:24:59 UTC
Created attachment 169797 [details]
generated docx with poi and jodconverter
Comment 2 Heiko 2021-02-17 06:26:02 UTC
Created attachment 169798 [details]
generated docx uploaded saved and downloaded with google docs
Comment 3 Heiko 2021-02-17 06:26:49 UTC
Created attachment 169799 [details]
generated docx openened and saved with MS-Word
Comment 4 Heiko 2021-02-17 06:27:50 UTC
Created attachment 169800 [details]
generated docx opened updated indices and saved with MS-Word
Comment 5 NISZ LibreOffice Team 2021-02-17 14:17:09 UTC
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:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=5cdb14345842c07eb1a466897753da910e9488f8

author	Mike Kaganski <mike.kaganski@collabora.com>	2019-12-13 09:36:39 +0300
committer	Mike Kaganski <mike.kaganski@collabora.com>	2019-12-16 17:23:57 +0100

tdf#129353, tdf#129402: fix node creation on index import
Comment 6 NISZ LibreOffice Team 2021-02-17 14:19:43 UTC
Adding CC to: Mike Kaganski
Comment 7 Mike Kaganski 2021-04-03 11:06:34 UTC
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.
Comment 8 eisa01 2023-03-18 20:12:27 UTC
Given the screenshots in comment #5 this is not a macOS bug