Bug 92142 - TABLE: Table of contents cannot be created in specific document
Summary: TABLE: Table of contents cannot be created in specific document
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.3.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks: DOCX-TableofContents
  Show dependency treegraph
 
Reported: 2015-06-17 20:40 UTC by Edi Ćiković
Modified: 2017-12-25 11:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
The file in which the table of contents willl not update properly (566.17 KB, application/vnd.oasis.opendocument.text)
2015-06-20 20:07 UTC, Edi Ćiković
Details
File which was used to create the previously uploaded file (10.51 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-06-20 20:56 UTC, Edi Ćiković
Details
A document that demonstrates the problem (15.89 KB, application/vnd.oasis.opendocument.text)
2015-12-09 02:23 UTC, Luke Kendall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edi Ćiković 2015-06-17 20:40:39 UTC
When attempting to create a table of contents only the title of the table of contents appears. This works perfect on any other document. When I tried to copy part of this document on an existing document with a table of contents and updating it, it became empty. 
I have then asked a friend to generate a table of contents in Word and resend the document, however when I opened the document there was no table of contents, even though that usually works.
Comment 1 Buovjaga 2015-06-19 17:10:02 UTC
Please provide the document, otherwise we can't confirm the problem.
You can sanitize private information first:
https://wiki.documentfoundation.org/QA/Bugzilla/Sanitizing_Files_Before_Submission#Sanitize_file_text

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the document.
Comment 2 Edi Ćiković 2015-06-20 20:07:27 UTC
Created attachment 116684 [details]
The file in which the table of contents willl not update properly
Comment 3 Edi Ćiković 2015-06-20 20:08:59 UTC
I apologize, I have uploaded the document originally, however it seems it didn't save the file.
Comment 4 Buovjaga 2015-06-20 20:12:40 UTC
Confirmed that TOC won't add the headings. I don't have any idea of the cause.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 3ecef8cedb215e49237a11607197edc91639bfcd
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-19_23:16:58
Locale: fi-FI (fi_FI)
Comment 5 Edi Ćiković 2015-06-20 20:18:00 UTC
A thing worth noting is that this was originally in .docx format and first 3-4 pages are the ones that were in the original document and it seems that something in those pages is the cause for this.
Comment 6 Buovjaga 2015-06-20 20:27:46 UTC
(In reply to Edi Ćiković from comment #5)
> A thing worth noting is that this was originally in .docx format and first
> 3-4 pages are the ones that were in the original document and it seems that
> something in those pages is the cause for this.

Do you still have the original .docx? Would be nice to have it for testing.
Comment 7 Edi Ćiković 2015-06-20 20:56:55 UTC
Created attachment 116686 [details]
File which was used to create the previously uploaded file
Comment 8 Edi Ćiković 2015-06-20 21:01:13 UTC
I have uploaded the original .docx
I have only removed people's names.
I tried to generate a table of contents in this document and it doesn't work again. 
Furthermore, it seems that the preview of the table of contents is broken too. There are no headlines in the preview, however when I create a new table of contents on a new file it shows the headlines in the preview.
Comment 9 Alex Thurgood 2015-11-20 17:08:42 UTC
See also the ODT document from the original reporter of bug 95909 where I can reproduce the disappearing TOC as soon as I try to update it.
Comment 10 Luke Kendall 2015-12-09 02:21:36 UTC
I have the same problem.  I used the CreateSpace template.  I will attach the file.
I used Insert Indexes and Tables, clicked on the Style tab, selected  Level 1[Contents 1] entry on the left, selected the "CSP - Chapter Title" entry on the right, and click ed on the <- button to make that assignment.

Then I clicked OK.

The header for the TOC appeared, but no entries.

I remembered a bug report of entries not appearing unless they contained some user text (like a blank space), in addition to the auto-text provided for the chapter numbering. (I confess, I can't see how the text "# CHAPTER NAME" is being provided: I couldn't find it in the Styles and Formatting settings or the paragraph or the bullets and numbering panels.)  I did that because that bug certainly affects another file I have.  Anyway, after doing that, it didn't help: right-cliking at the empty body of the TOC and doing an Update Index or Table had no effect.

I'll attach the short file.  This is the .odt saved by LO after opening the CreateSpace .doc version.
Comment 11 Luke Kendall 2015-12-09 02:23:53 UTC
Created attachment 121154 [details]
A document that demonstrates the problem

This is the attachment I said I would add, in my previous comment.  I hope it helps.
Comment 12 Luke Kendall 2015-12-09 02:24:56 UTC
I should add, this is on Linux, using LibreOffice 5.0.3.2.
Comment 13 Luke Kendall 2015-12-09 02:29:50 UTC
I should add perhaps one odd thing I noticed: it took me several tries before my "setting" of the  "CSP - Chapter Title" to the Level 1 contents actually "stuck". I think I tried twice, and each time the empty TOC appeared.

So I did Undo, and tried again, and each time the setting for the TOC generation had reverted to "Contents 1".  Naturally, if LO was only looking for chapters using that style, it would have found no entries, so the empty table made sense to me.

Not so much sense, once the correct assignment had been made.
Comment 14 QA Administrators 2017-12-10 16:39:12 UTC Comment hidden (obsolete)
Comment 15 Timur 2017-12-25 11:09:44 UTC
As for ODT attachment 116684 [details] it's Heading 1 used in text is "Body Text" outline level and that's why it doesn't appear in ToC. Change back to Level 1 and it will. Problem was in previous conversion. 

As for DOCX  attachment 116686 [details] it's to-be-headings are just "Default Style". 
When changed to "Heading 1" style in LO 4.4 that was reported version, it stays "Body Text" outline level. Same with LO 5.3. 
But looks fixed with 5.4. and in master 6.1+, it becomes "Level 1" outline level.

So, WFM.
Didn't test Luke's attachment 121154 [details], he needs to go back to original.