Bug 139147 - Strange chapter numbering in DOCX file
Summary: Strange chapter numbering in DOCX file
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.5.1 rc
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.2.0 target:7.1.1
Keywords: bibisected, bisected, needUITest, regression
Depends on:
Blocks:
 
Reported: 2020-12-22 09:33 UTC by Peer Sommerlund
Modified: 2021-02-01 15:18 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
docx with corrupted chapter numbering (31.29 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-12-22 09:35 UTC, Peer Sommerlund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peer Sommerlund 2020-12-22 09:33:45 UTC
Description:
I have created a docx document in LibreOffice and edited it for a period.
I wanted to customize the numbered headings (1.1.1 style) - the document is in an unwanted state and I cannot modify it without saving to .ODT first.

I have attached a stripped down version of the problematic document.

Steps to Reproduce:
This is my guess, I have not tried.
1. edit a docx document for a while (do NOT save as ODT)
2. add numbering to the base Heading style (this is a mistake)
3. edit heading 1-4 to remove numbering
4. remove numbering from base heading style

Actual Results:
Chapter numbering are no longer affected by changes made in Functions->Chapter Numbering

Expected Results:
I would expect that I at any time could go to Functions->Chapter Numbering and add/remove numbering of heading 1-10


Reproducible: Didn't try


User Profile Reset: No



Additional Info:
The problem goes away if I save the file as ODT and then reload it.
Comment 1 Peer Sommerlund 2020-12-22 09:35:19 UTC
Created attachment 168405 [details]
docx with corrupted chapter numbering
Comment 2 Justin L 2020-12-22 14:13:37 UTC
I used bibisect-linux-x64-6.4 to identify
author	Vasily Melenchuk on 2020-06-12 01:13:55 +0200
commit 129006ee5bec721bfb8bae9cd55586b353e230b7 
tdf#120394: DOCX list import: simplify zero width space hack

CC'd Vasily
Comment 3 Justin L 2021-01-22 19:24:58 UTC
I think the concern here is that there is no UI way to tinker with GetListFormat() once it gets a custom format.

So the UI should    void ClearListFormat() { sListFormat = std::nullopt; }
if appropriate format options are changed.
Prefix and suffix and show sublevel are obvious ones. [Sublevel should be enabled for level 1 if HasListFormat().]
Comment 4 Justin L 2021-01-23 09:15:45 UTC
proposed fix at http://gerrit.libreoffice.org/c/core/+/109839
Comment 5 Commit Notification 2021-01-26 16:01:33 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/55933f49f5a04708d27dc69e8778ec126646e3a5

tdf#139147 sw outline UI: allow clearing of custom list format

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Justin L 2021-01-26 16:07:52 UTC
Peer - I hope this addresses the issue you raised here about being unable to adjust the heading via the UI. I have requested a backport to 7.1, so if that goes through, it should be in the fresh version in a month or two.
Comment 7 Commit Notification 2021-01-27 10:36:28 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/89516b2be525a01862eacdef2276f0699ed87e3d

tdf#139147 sw outline UI: allow clearing of custom list format

It will be available in 7.1.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Peer Sommerlund 2021-02-01 10:18:28 UTC
(In reply to Justin L from comment #6)
> Peer - I hope this addresses the issue you raised here about being unable to
> adjust the heading via the UI. I have requested a backport to 7.1, so if
> that goes through, it should be in the fresh version in a month or two.

Ok. I'll check once 7.1 is released.
Comment 9 Justin L 2021-02-01 15:18:35 UTC
(In reply to Peer Sommerlund from comment #8)
> Ok. I'll check once 7.1 is released.
Please note that it will NOT be in 7.1.0 - it will be in 7.1.1, which will be about a month from now.