Bug 141925 - Table of Contents Doesn't Put in Blank Numbered Items Generated via Chapter Numbering
Summary: Table of Contents Doesn't Put in Blank Numbered Items Generated via Chapter N...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: preBibisect
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2021-04-27 08:33 UTC by Farhood
Modified: 2023-10-12 18:11 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
141925_emptyParaTocEntries.odt: custom style auto-creates Chapter heading (10.85 KB, application/vnd.oasis.opendocument.text)
2021-05-01 08:20 UTC, Justin L
Details
141925_emptyParaTocEntriesB.odt: a counter-example (12.34 KB, application/vnd.oasis.opendocument.text)
2021-05-01 08:35 UTC, Justin L
Details
Legitimate use of empty headings (15.85 KB, application/vnd.oasis.opendocument.text)
2023-10-05 09:31 UTC, ajlittoz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Farhood 2021-04-27 08:33:49 UTC
Description:
The Title is pretty self-explanatory but the gist is that.

Assume I have generated a bunch of chapter headers, sub headers and so on.

I'm using chapter numbering to number these. I use a prefix like "Chapter" for my level 1 outlines. Use something like "Subchapter" for level 2 and so on.

When each chapter line is generated, if they are left empty (like It has generated "Chapter 2:") and you go to the next line, then the ToC will not respect these while generating.

Currently you have to manually go the each chapter number generated, and type some spaces for ToC to recognize it. It's also very weird because the Navigator component can see all your chapters with ease.

Steps to Reproduce:
1.Create chapter numbering schemes with a specified prefix
2.Leave them empty (don't type anything infront of them)
3.Create a ToC.

Actual Results:
It creates an empty ToC.

Expected Results:
It should not create an empty ToC.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 7.1.2.2 / LibreOffice Community
Build ID: 10(Build:2)
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.1.2~rc2-0ubuntu0.20.04.1~lo3
Calc: threaded
Comment 1 Justin L 2021-05-01 08:16:08 UTC
repro 7.2+, and already happened in bibisect43all at LO 3.5. Assume inherited.

It seems to me like this is a feature. If there are outline items with no content, then I could easily see why they would be undesirable in a TOC. Otherwise a lot of empty lines could show up in the TOC.
Comment 2 Justin L 2021-05-01 08:20:07 UTC
Created attachment 171553 [details]
141925_emptyParaTocEntries.odt: custom style auto-creates Chapter heading

P.S. This has nothing to do directly with chapter numbering. Any style specifying an outline level and containing numbering can demonstrate the suggestion.
Comment 3 Justin L 2021-05-01 08:35:35 UTC
Created attachment 171554 [details]
141925_emptyParaTocEntriesB.odt: a counter-example

Insert a TOC in this document, and it will simulate what could happen to documents if OP's suggestion is followed.

There are some compatibility issues at stake here as well.

My take on the issue is that you design your documents based on what the program provides. Rarely would chapter numbering be so fluid that it requires numbering to handle it. Rarely are empty numberings deployed.  (In fact, pressing "Enter" after one of these REMOVES it.)

Based on the difficulty in actually implementing empty-paragraph-numbering, update-TOC compatibility concerns, and a potential argument from the opposite side, I suggest WONTFIX.
Comment 4 Justin L 2021-05-01 12:35:06 UTC
see bug 70756 which indicates some empty paragraphs accidentally get OutlineLevel set to one on them. I'd say that strengthens my WONTFIX argument.
Comment 5 Dieter 2022-08-20 04:27:31 UTC
I think the problem is indierctly covered by 149282. There was the decision NOTABUG. Sounds reasonable for me.

=> RESOLVED NOTABUG
Comment 6 ajlittoz 2023-10-05 09:31:03 UTC
Created attachment 190036 [details]
Legitimate use of empty headings

I disagree with the decision NOTABUG.

The "compatibility feature" was probably motivated by the frequency of such empty Heading_n paragraphs in Word-originating documents. The majority of document-processing applications (Word, Writer, …) use them as basic typewriters. Word, which has poorer styling features, is more prone to produce empty heading paragraphs when users hit Enter to create vertical space. In Writer, pressing Enter after a Heading_n-styled paragraph switches to Text_Body. Therefore, empty headings are less frequent in Writer-created documents.

The feature was then conceived as an automatic correction attempt for an erroneous use of the applications.

Unfortunately, this approach is wrong. Empty headings can legitimately be used. I show this in LOBugEmptyHeading.odt attachment. It is a skeleton novel. Chapter numbering is used to automatically create chapter headings in the form "Chapter nn". I'd expect these headings to be collected in the TOC. They aren't because of the "feature".

In addition, if one of the chapters has an explicit title, we get a serious discrepancy in the TOC where only the explicit heading is reported; all empty (implicit) headings are missing.

Note also that
(In reply to Justin L from comment #3)
> […] Rarely are empty numberings deployed.  (In
> fact, pressing "Enter" after one of these REMOVES it.)
is wrong. Contrary to list items, empty headings are perfectly accepted by Writer.

I strongly advocate to reconsider the question.

Eventually, add a compatibility check box to continue "fixing" DOC(X) documents but respect author choice of using the auto-numbering feature for their empty headings. I don't consider adding a space to make the heading as non-empty a valid workaround because AutoCorrect can delete them (and this setting may be useful elsewhere than on headings).

(BTW, AutoCorrect Remove_empty_paragraphs does not seem to have any effect, even after forcing Tools>Update>Update All)