Bug 65461 - TOC index mark AND numbering in paragraph produce erratic TOC output
Summary: TOC index mark AND numbering in paragraph produce erratic TOC output
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-06 14:05 UTC by Yury
Modified: 2017-12-25 15:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
TOC goes bad with both numbering and index mark in one paragraph (12.51 KB, application/vnd.oasis.opendocument.text)
2013-06-06 14:07 UTC, Yury
Details
index mark by itself is okay (11.31 KB, application/vnd.oasis.opendocument.text)
2013-06-06 14:07 UTC, Yury
Details
proofpic (with one paragraph) (18.31 KB, image/png)
2013-06-06 14:09 UTC, Yury
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yury 2013-06-06 14:05:50 UTC
If one combines a numbering and a TOC index mark in a paragraph, the TOC generated is completely wrong. Both correct entry (index entry) and incorrect entry (complete paragraph) are included.

The order in which index entry and numbering are applied to paragraph is irrelevant.

To reproduce -- 1) start with an empty doc, add heading 1 in 'heading 1', heading 2 in 'heading 2', and the arbitrary line in 'default'. 

2) Apply an index entry for 'TOC' to the, say, first two words of 'default'-styled paragraph. Make it 3rd level entry (possibly irrelevant). 

Insert/update TOC => So far, so good.

3) Apply a numbering to 'default'-styled paragraph. Make it, say, 'Numbering 1' style, the outline level is irrelevant.

Insert/update TOC => TOC goes bad (screenshot and sample doc attached).

If 2) and 3) are exchanged, the result is the same.
Comment 1 Yury 2013-06-06 14:07:27 UTC
Created attachment 80404 [details]
TOC goes bad with both numbering and index mark in one paragraph
Comment 2 Yury 2013-06-06 14:07:55 UTC
Created attachment 80405 [details]
index mark by itself is okay
Comment 3 Yury 2013-06-06 14:09:55 UTC
Created attachment 80406 [details]
proofpic (with one paragraph)
Comment 4 Konstantin Tkachenko 2014-02-17 20:11:38 UTC Comment hidden (obsolete)
Comment 5 Konstantin Tkachenko 2014-02-17 20:16:36 UTC
(In reply to comment #4)
> Also reproducible with 4.2.0.4 (Win7) with pretty big document (unable to
> attach cause of copyright).
> BI wasn't been able to reproduce it on a small example under openSuse 13.1
> (LibreOffice 4.1.4.2).
By the way. In my case it was a combination of TOC with outline numbering and alphabetical index (with index marks on some of the outlines). The alphabetical index was erratic
Comment 6 Yury 2014-02-18 05:17:41 UTC
Well, this should be reproducible "everywhere", because it seems the common logic of TOC building assumes that only complete paragraphs-headings would be selected for inclusion in the TOC.

I, in this example, wanted inline headings (parts of paragraphs) with numberings.

So, index (TOC index) marks by themselves are okay, but add paragraph numbering on those, and things go wrong -- you get one TOC entry with TOC index mark only and one TOC entry with complete paragraph and number.

BTW, I've been able to side-step this problem and to get /ersatz/ numbered inline headings with fairly minimal amount of overhead. Do as follows:
1) Insert reference to upper-level heading.
1.1) Add dot and number to it manually - you have ersatz numbering now.
2) Place TOC index entry with appropriate level on the part of the paragraph, including ersatz numbering in it.
3) Update TOC, obviously.

***

That said, styles of numberings are quite a convoluted and error-prone matter in LibO/OOO. Their logic of work seems to be multi-staged (e.g., why can't I change numbering style in the paragraph style taken from template - it's grayed out -- or, e.g., what numbering style is used on the paragraph, after all, finally, and is there a place where I could control it in whole?).
Worse, controlled from many places and by different means, numberings are easily damaged.
Comment 7 Joel Madero 2015-05-02 15:42:55 UTC Comment hidden (obsolete)
Comment 8 Yury 2015-05-03 05:25:10 UTC
4.4.3.2 linux amd64 -- the issue's still there.

The only difference is the index mark starting not on the paragraph start (in the example -- paragraph with word 'else' marked) now generates the entry correctly aligned with the 'index mark' one.
Comment 9 Yury 2015-05-03 05:37:16 UTC
In fact, this issue involves two matters.

One was TOC index mark being put into TOC at incorrect level, if marked not from the paragraph start, in presence of numbering/outline level in the paragraph itself -- this seems to be solved.

Another was (and is) the way of including the non-heading paragraphs with 'non-bodytext' outline level into TOC was (and is) undefined/unspecified.

Everything in the paragraph goes into the TOC. Index mark sort of solves this, BUT -- there is no way to include the (containing) paragraph numbering as well. The #86905 is related, I guess.
Comment 10 QA Administrators 2016-09-20 09:36:51 UTC Comment hidden (obsolete)
Comment 11 Yury 2016-09-20 16:51:30 UTC
Issue still there in:
Version: 5.2.1.2
Build ID: 31dd62db80d4e60af04904455ec9c9219178d620
CPU Threads: 2; OS Version: Linux 4.4; UI Render: default; 
Locale: ru-RU (en_GB.UTF-8); Calc: group

Entries go into index twice, once with the selection on which index mark's put, and once with the (complete?) paragraph text.

And it's not the numbering itself that triggers the inclusion of the bogus entry in TOC but the 'Outline level' other than 'Body text' in Paragraph properties dialog, tab 'Outline & Numbering'.

Doesn't look logical.
Comment 12 Xisco Faulí 2017-09-29 08:51:09 UTC Comment hidden (obsolete)
Comment 13 Timur 2017-12-25 15:51:10 UTC
Attachment 80404 [details] is already wrong because 'default'-styled paragraph that appears in ToC is set to Outline level 3, see Format-Paragraph-Outline&Numbering tab.
So the result is logical, entries go into index twice.

(In reply to Yury from comment #9)
> (bug) is the way of including the non-heading paragraphs with
> 'non-bodytext' outline level into TOC was (and is) undefined/unspecified.
It's normal. Question is why are these outlined.

Test must be done from scratch. I wasn't able to repro per Description. 
And I don't see anyone confirmed this bug. I close as Not a bug.