Writer: empty headings not included in TOC

Fedora 38
KDE Plasma desktop

Working on problematic documents submitted by users of AskLO, I noticed that empty headings (usually styled Heading n) are not collected into the TOC. This happens even when the heading is numbered. Apparently, empty user-text (excluding the number) is sufficient to trigger this “filtering out”. I never noticed this before, but never intentionally created empty headings.

IMHO if user erroneously add an empty heading, s/he should be blamed. Writer should not try to “fix” the document on its own.

I guess this may be a “feature” introduced to facilitate life of users who vertically space with empty paragraphs. However this is not a good idea because it defers the time when they realise they’re formatting the wrong way. And, anyway, it can also cause distortions in numbering. It is at least visible in the TOC.

And perhaps, e.g. in novels, it may be desirable to have empty headings, keeping only the number.

When did this “feature” appear? In Which release?

It is there in Maybe this can provide more information: Bug 141925 - Table of Contents Doesn’t Put in Blank Numbered Items Generated via Chapter Numbering

There is a workaround if an empty heading is required, either a space or a frame anchored As Character will generate an entry.

tdf#149381; it also has an answer to the “When did this “feature” appear? In Which release?”. The answer is: it pre-dates even OOo 1.0.

See also 149288 – Create an option to hide empty headings in the Navigator - where I consider filtering out from Navigator to be bad (but generally, writing that comment, I confused what was the actual behavior).

I read the bug reports which links were kindly provided by @EarnestAl and @mikekaganski. I feel the status quo argumentation is faulty. I’ll show why in a sample document I’ll attach to one of the bug reports as soon as I have time.

Filtering out empty outline entries (any way they are created, with Heading n or other setting in a paragraph) is only a lazy work around for bad direct formatting habits (vertical spacing with empty paragraphs). This leads to a wrong document structure which should be fixed by its author. Hiding them in the TOC masks the origin. And as LO oldtimers know, average users rarely look at the Navigator to detect structure anomalies.

I disagree with the Word compatibility argument, though I understand it (an alien document should be displayed as much as possible as in the original app). Word is not as powerful as Writer when it comes to styles and their expressive creativity. But spurious (= non intentional not semantically meaningful) empty heading entries are as faulty in Word as in Writer. I set apart the case of numbered “void” entries because they make sense in novels and other literary works. And I consider adding a space (for work around) to such headings is even worse than the present behaviour.

EDIT 2023-10-05
I added a comment to tdf#141925 explaining why I consider empty headings should be included in TOC with a demo sample file.
IMHO, the “feature” results from an attempt to fix bad user habits of vertically spacing with empty paragraphs. Empty headings are more likely to occur in Word because I am not sure there exists the automatic style switch when you hit Enter (in Writer, Heading nText Body).