Bug 143692

Summary: FILEOPEN DOCX Outline level is not inherited from style assigned as Chapter Numbering
Product: LibreOffice Reporter: NISZ LibreOffice Team <libreoffice>
Component: WriterAssignee: Justin L <jluth>
Status: VERIFIED FIXED    
Severity: normal CC: buzea.bogdan, jluth, nemeth, varga.balazs3
Priority: medium Keywords: filter:docx
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=120464
Whiteboard: target:7.3.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108760    
Attachments: Screenshot of the original document side by side in Word and Writer

Description NISZ LibreOffice Team 2021-08-02 14:47:35 UTC
Created attachment 174030 [details]
Screenshot of the original document side by side in Word and Writer

attachment 138328 [details] from bug 114363 contains the style “Head non TOC” which is inherited from Heading 1.
This “Head non TOC” style inherits its Outline level 1 setting in Word, but loses it in Writer.


Steps to reproduce:
    1. Open attachment 138328 [details]
    2. In the Navigator check the settings of the “Head non TOC” paragraph style

Actual results:
On the Outline & List panel the Outline level is “Text Body”.

Expected results:
Should be “Level 1” like in Word.

LibreOffice details:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 7c38362dbe1922c9825dffb463072030948d406b
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: CL

Also in 7.0, 6.0, 5.0, 4.0, 3.5.
Comment 1 Justin L 2021-08-02 15:59:22 UTC
To do this "very well" will be rather tricky. The problem is ALL in how LibreOffice implements "Chapter Numbering" - which is a uniquely LO concept.

It would be fairly simple to duplicate the outlineLevel into every style that should inherit, but that would make it harder to manage nested styles. It is only NECESSARY to do this for styles that inherit from whatever gets stuck into Chapter Numbering (although identifying that is not trivial).

Since OutlineLevel is a rather obscure setting, it probably wouldn't be too bad to spam it as an attribute onto every inheriting style. (We already do so much spamming as it is, so what is one more instance...)

This has nothing to do with "Heading X" styles, so don't make that assumption.
Comment 2 Justin L 2021-08-19 18:15:33 UTC
proposed fix at http://gerrit.libreoffice.org/c/core/+/120756
Comment 3 Justin L 2021-08-20 18:59:10 UTC
(In reply to Justin L from comment #1)
> It is only NECESSARY to do this for styles that inherit from whatever gets
> stuck into Chapter Numbering (although identifying that is not trivial).
In actual fact, ALL inheritance was busted, so everything needed fixing.
Comment 4 Commit Notification 2021-08-23 04:31:17 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2aca75ef2ac84360d13e9000ba3063a7a42b6f6f

tdf#143692 writerfilter: fix outlineLevel import x3

It will be available in 7.3.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 5 BogdanB 2021-08-24 05:09:06 UTC
Justin please mark this as resolved.

I have verified this bug and Level 1 is well imported in Outline.
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: fbe183bbb05220a4ccc51952445b1797bb498403
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 Commit Notification 2021-08-24 06:30:00 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/763f1e8236657a20b359991057679cf12bfac4f5

tdf#143692 writerfilter CN: reapply lost OutlineLevel

It will be available in 7.3.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 7 BogdanB 2021-08-24 07:50:30 UTC
I have verified this bug and Level 1 is well imported in Outline.
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: fbe183bbb05220a4ccc51952445b1797bb498403
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded