Created attachment 143804 [details]
Test MSO DOCX with ToC
Writer and Word seem to be mutually not interoperable on import to recognize entries set in Table of Contents (ToC).
While ToC looks fine on import, Update index shows that they don't really recognize and import ToC structure.
To test, open in LO attached Test DOCX with ToC created in MSO and right-click Update index. Structure is changed and that is obvious because default tab stops are set differently. That doesn't happen with custom ToC saved in ODT.
I'll set as Enhancement.
This is Fileopen. Filesave to DOC and DOCX is another issue. Update index on fileopen of RT file loses structure.
Created attachment 143805 [details]
Test MSO DOC with ToC
Build ID: 72b099d279e7096d41a04fe8c0dd493a5fc18a33
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded
*** Bug 118259 has been marked as a duplicate of this bug. ***
Created attachment 144984 [details]
Sample DOCX with different fonts
And here's a sample with different fonts in the ToC that get lost upon update. While it's not strictly structure, I'd say it belongs in this ticket (if not, I can open a separate one).
*** Bug 126998 has been marked as a duplicate of this bug. ***
Created attachment 160582 [details]
Comparison of MSWord vs Writer rendering
This screenshots show this issue. It also highlight the importance of keeping those tabs in documents like this one, which try to keep a proper alignment of numbers and titles (a style so necely done be LaTeX for example). This is IMHO more important than it seems.
The style is kept upong loading the file, but is lost when updateing the TOC.
Here is a possible hint:
My guess is that Writer's and Word's TOC systems are different (Writer's is more sophisticated, I'd say). In Writer one can explicitly define that a TAB must exist between number and title. However, Word does not specify anything about the separa tion of number and title. What Word does, I think, is use the same format used in the numbering of headers in the document. If the document has TABS after section numbers then the TOC will have TABS, too.
That is defined in the format of the multilevel numbering scheme. "Define new multilevel list", hitting "More >>" to expand the dialog to more options, and selecting an option for "Number followed by:". Can be TAB, SPACE or NOTHING. and this affects both the headings throughout the document, and the Table of Contents.
Then, to achieve the same results, Writer could look at the existing format of multilevel heading numbering (which is correctly read). And add this TAB to TOC elements if the multilevel numbering uses TABS.