Bug Hunting Session
Bug 114363 - TOC: Index update causes entries to duplicate if ToC created from Outline and Additional heading styles (in a specific document)
Summary: TOC: Index update causes entries to duplicate if ToC created from Outline and...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: DOCX-TableofContents
  Show dependency treegraph
 
Reported: 2017-12-09 12:53 UTC by Jens Troeger
Modified: 2019-03-24 12:56 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Update ToC to see duplication. (37.59 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-12-09 12:53 UTC, Jens Troeger
Details
Left before, right after ToC update. (66.34 KB, image/jpeg)
2017-12-09 12:54 UTC, Jens Troeger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Troeger 2017-12-09 12:53:19 UTC
Created attachment 138328 [details]
Update ToC to see duplication.

Updating the ToC index object, either calling update() through UNO or right-clicking on the ToC in the UI causes the top-level entries to duplicate.

See attached document and screen shot, see also https://forum.openoffice.org/en/forum/viewtopic.php?t=91448#p433507
Comment 1 Jens Troeger 2017-12-09 12:54:28 UTC
Created attachment 138329 [details]
Left before, right after ToC update.
Comment 2 Jens Troeger 2017-12-09 12:59:02 UTC
Also happens on 5.4.3.2 and 6.0.0 beta, both Mac and Linux.
Comment 3 MM 2017-12-09 13:08:40 UTC
Confirmed with 

Version: 5.1.6.2
Build ID: 07ac168c60a517dba0f0d7bc7540f5afa45f0909
CPU Threads: 2; OS Version: Linux 4.4; UI Render: default; 
Locale: en-US (en_US.UTF-8); Calc: single

and

Version: 6.1.0.0.alpha0+
Build ID: 1d8cb97fea57b81a1ab151b88c2180e646bd401b
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-12-07_01:51:53
Locale: en-US (en_US.UTF-8); Calc: threaded

Not only you'll get a double index, but you can't undo it.
Comment 4 Telesto 2017-12-10 11:12:18 UTC
Showing duplicates on file open
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

and
Versie: 4.2.0.4 
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71

Showing duplicates after updating the TOC in
Version: 4.3.0.4
Build ID: 62ad5818884a2fc2e5780dd45466868d41009ec
Comment 5 Wolfgang Jäger 2017-12-10 23:53:26 UTC
(Just reporting some experiments.)
The example file is provided as .docx. The issue persists if the document is first saved as .odt and then reloaded. Creating the TOC anew in the reloaded document works without a problem and the new TOC does not show the issue. 
With LibO V5.4.3.2 x64 on Win 10. 
Same with V6.0.0.0beta1 x64 on Win 10.
Comment 6 Wolfgang Jäger 2017-12-11 00:19:55 UTC
AOO 4.1.3 does not show the issue.
Comment 7 Timur 2017-12-25 10:09:28 UTC
Happens only if ToC created both from Outline and Additional heading styles.
So, looks like user error to me and not a bug. 
Turn of either of them and you'll get what you want.
Comment 8 Jens Troeger 2017-12-25 19:10:25 UTC
These are customer documents. Could somebody please elaborate on what went wrong and how to go about the issue? I don't quite follow @Timur's explanation.
Comment 9 Timur 2017-12-26 11:32:17 UTC
ToC right-click, Edit. 
Turn off Outline OR Additional styles, depending what you want. 
What you ask is for ask.libreoffice.org and not for bug report.
Comment 10 Timur 2017-12-26 11:40:06 UTC
(In reply to Wolfgang Jäger from comment #6)
> AOO 4.1.3 does not show the issue.

Interesting, that must've been changed because this behavior is from OO.
We might say this is a bug and this should not duplicate if the same, like AOO. 
But I'm not in favor of that approach. 
I'd like to have it displayed exactly as checked. 
Those who set it up should know what they're doing.
Comment 11 Timur 2017-12-26 11:47:42 UTC
Note: saving this docx shows Bug 112539.
Comment 12 Jens Troeger 2017-12-29 04:53:39 UTC
I disagree.

Considering that the document is a DOCX Word native format I take it that Word is the reference and defines the baseline behavior. When I update the ToC in Word, entries are _not_ duplicated. It seems that AOO does not have this problem either.

Clearly there is a regression between Word and LO.

So instead of expecting LO users to tweak the document's settings after it's loaded (see this comment: https://bugs.documentfoundation.org/show_bug.cgi?id=114363#c9), I think LO should handle this like the baseline reference: without duplicating entries and without expecting the user to tweak anything.
Comment 13 Timur 2017-12-29 07:47:52 UTC
Please don't set wrong status yourself. Reopened is where fix doesn't work. 
This one is not confirmed, not only a behavior but a possible fix. You may wait for a dev or UX to confirm, but cannot do it yourself.
Comment 14 Dieter Praas 2017-12-29 16:46:47 UTC
(In reply to Timur from comment #7)
> Happens only if ToC created both from Outline and Additional heading styles.
> So, looks like user error to me and not a bug. 
> Turn of either of them and you'll get what you want.

I disagree. If I create a document and create ToC both from Outline and form Heading Style there is no dubication
Comment 15 Dieter Praas 2017-12-29 16:51:41 UTC
I can also (In reply to MM from comment #3)
> Confirmed with 
> 
> Version: 5.1.6.2
> 
> and
> 
> Version: 6.1.0.0.alpha0+

> 
> Not only you'll get a double index, but you can't undo it.

I can also confirm it but only wth that specific document from the original bug report => Set to NEW
Comment 16 Jens Troeger 2018-03-16 10:56:34 UTC Comment hidden (no-value)
Comment 17 QA Administrators 2019-03-17 03:51:42 UTC Comment hidden (obsolete)
Comment 18 Dieter Praas 2019-03-17 12:38:49 UTC
Still reproducible in

Version: 6.3.0.0.alpha0+ (x64)
Build ID: 91cdf22b88a4f7bec243c8fb187627e766d3294c
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-03-08_00:38:10
Locale: en-US (de_DE); UI-Language: en-US
Calc: threaded
Comment 19 Jens Troeger 2019-03-24 12:56:46 UTC
Still reproducible in LibreOffice 6.2.1.2 7bcb35dc3024a62dea0caee87020152d1ee96e71.