Bug 107683 - FILESAVE: DOCX - Heading styles incorrectly exported with numbering properties tag <w:numPr>
Summary: FILESAVE: DOCX - Heading styles incorrectly exported with numbering propertie...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: filter:docx
: 133802 (view as bug list)
Depends on:
Blocks: Writer-Styles-Heading DOCX-Bullet-Number-Outline-Lists
  Show dependency treegraph
Reported: 2017-05-07 14:21 UTC by Yousuf Philips (jay) (retired)
Modified: 2022-06-22 14:35 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

sample (12.07 KB, application/vnd.oasis.opendocument.text)
2017-05-07 14:28 UTC, Yousuf Philips (jay) (retired)
Screenshot of the exported example document in LO master and word (119.67 KB, image/png)
2019-09-17 13:24 UTC, Gabor Kelemen (allotropia)

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2017-05-07 14:21:40 UTC
1) Open attached doc
2) Export to docx
3) Open docx in MS Word
4) Select the 'Outline Level 1 Paragraph Style' line or any of the ones below it
5) Notice that the bullets button is toggled in the paragraph group of the Home tab

Build ID: 74ccd02eda2d6325a27266fd935aba29b3d75020
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-04-27_23:51:14
Locale: en-US (en_US.UTF-8); Calc: group

LO is incorrectly exporting headings outline level info into <w:numPr> tags, when it is already defined in the <w:outlineLvl> tag, like so

<w:style w:type="paragraph" w:styleId="Heading4">
      <w:ilvl w:val="3" />
      <w:numId w:val="1" />
    <w:outlineLvl w:val="3" />

This is how MS word exports it

<w:style w:type="paragraph" w:styleId="Heading4">
    <w:outlineLvl w:val="3" />
Comment 1 Yousuf Philips (jay) (retired) 2017-05-07 14:28:27 UTC
Created attachment 133132 [details]
Comment 2 Yousuf Philips (jay) (retired) 2017-05-14 00:55:46 UTC
@Miklos: Have an opinion about this issue?
Comment 3 Buovjaga 2017-06-02 18:39:08 UTC
Yep, confirmed with MSO 2013 and
Build ID: d8e704ef30a6d7f606e58b25be54bbe79c9e40b6
CPU threads: 4; OS: Windows 6.29; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-06-02_00:43:23
Locale: fi-FI (fi_FI); Calc: group
Comment 4 Justin L 2018-01-13 07:14:39 UTC
See bug 76817 and https://gerrit.libreoffice.org/47828. Not exactly what this bug report is requesting, but similar. It prevents printing numId/iLvl for Outlines in document.xml, while this report is about styles.xml.

Heading X might not be the best style to use for testing, since it is handled as a special case in .docx import. It uses the special, built-in Outline list style (aka Chapter Numbering). So, actually, in the ODT, Heading 1 IS turning on numbering - it just happens to be using display character NONE, but numbering itself is enabled.  (Heading 1 properties - Numbering Style = Outline Numbering). So there SHOULD be a numId and ilvl associated with Heading 1.

Roundtripping with Word 2003, I still see numPr with ilvl and numId. OutlineLvl doesn't contain any connection to the numId, and documentation doesn't make any link between ilvl and OutlineLvl.

As far as I can see, LO is handling the styles.xml part OK.
Comment 5 QA Administrators 2019-02-14 03:48:47 UTC Comment hidden (obsolete)
Comment 6 Gabor Kelemen (allotropia) 2019-09-17 13:24:17 UTC
Created attachment 154229 [details]
Screenshot of the exported example document in LO master and word

Still present in:

Verzió: (x64)
Build az.: 4883da6fd25e4645a3b30cb58212a2f666dae75a
CPU szálak: 8; OS: Windows 10.0; Felületmegjelenítés: GL; VCL: win; 
Területi beállítások: hu-HU (hu_HU); Felület nyelve: hu-HU
Calc: CL
Comment 7 NISZ LibreOffice Team 2020-06-16 10:44:05 UTC
*** Bug 133802 has been marked as a duplicate of this bug. ***
Comment 8 NISZ LibreOffice Team 2021-01-25 09:35:52 UTC Comment hidden (obsolete)
Comment 9 Xisco Faulí 2021-01-25 10:18:11 UTC
(In reply to NISZ LibreOffice Team from comment #8)
> 08cebde32b71a64eeb6d4c1f3d6aedfbcfe56371 is the first bad commit
> commit 08cebde32b71a64eeb6d4c1f3d6aedfbcfe56371
> Author: Norbert Thiebaud <nthiebaud@gmail.com>
> Date:   Tue Oct 20 00:10:59 2020 -0700
>     source 9e455724e50bf512683b1cddfeb7493e047c19ae
>     source 9e455724e50bf512683b1cddfeb7493e047c19ae
> :040000 040000 d5e4628df3d0c3e59686871229b494ad9c199c0a
> e00be83b1cda0cae080c4bf9f902baf66bf7bfaa M      instdir

I'm sorry to say the commit was just reverted in master, sigh.
See https://cgit.freedesktop.org/libreoffice/core/commit/?id=32d11fb200d45cdacb973b625488d0b8bbee6d81
Comment 10 Justin L 2022-06-22 14:35:18 UTC
(In reply to Justin L from comment #4)
> As far as I can see, LO is handling the styles.xml part OK.
I'm going to mark this as NOTABUG. I worked on lists/chapter numbering extensively in LO 7.3, and from what I read here (this bug and duplicate 133802), I don't notice anything that I would consider incorrect.