Bug 125150 - Table of Contents disappears if empty when saving as docx
Summary: Table of Contents disappears if empty when saving as docx
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: dataLoss, filter:docx
Depends on:
Blocks: DOCX-TableofContents
  Show dependency treegraph
 
Reported: 2019-05-07 06:59 UTC by arrowdodger
Modified: 2020-11-30 10:18 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file to reproduce the problem (9.54 KB, application/vnd.oasis.opendocument.text)
2020-11-30 10:18 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description arrowdodger 2019-05-07 06:59:44 UTC
Description:
Reloading a .docx file with empty Table of Contents makes it go away and introduce a new, stange-named style.

Steps to Reproduce:
1. Create empty document
2. "Insert" -> "Table of Contents and Index" -> "Table of Contents, Index or Bibliography"
3. In the dialogue press "OK" to create a Table of Contents.
4. Save the file as "Word 2007-2019 (.docx)".
5. Close the document and open again.

Actual Results:
1. The ToC is gone.
2. New "TOA Heading" style is added to the list of ToC styles.

Expected Results:
1. ToC is still there, despite being empty.
2. New style is not created, but default "Contents Heading" style us used.


Reproducible: Always


User Profile Reset: No



Additional Info:
Expected results can be observed when saving to .odt instead of .docx.
Comment 1 Roman Kuznetsov 2019-05-07 08:08:29 UTC
repro in

Version: 6.3.0.0.alpha0+
Build ID: d6e8e41c22023bc15cc4c9659b33c1cc3d6edb75
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-05-05_23:45:44
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 2 Timur 2019-05-09 09:34:36 UTC
Looks like ToC never was saved OK so I'll put Inherited. 
New "TOA Heading" style was added later.
But this is special case so I'll mark minor.
Comment 3 NISZ LibreOffice Team 2020-11-30 10:18:36 UTC
Created attachment 167676 [details]
Example file to reproduce the problem

Still present in:

Version: 7.2.0.0.alpha0+ (x64)
Build ID: f7e2f5bca938aa916830e07895d2da6820282055
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: CL

Adding a new paragraph with Heading 1 style and updating the TOC in odt puts the new paragraph into the TOC but this is not possible if this file was saved as docx.