Bug 150408 - "Legal numbering style" is not applied to list levels with <w:isLgl/> tag
Summary: "Legal numbering style" is not applied to list levels with <w:isLgl/> tag
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low enhancement
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.2.0 target:24.8.0 target:24...
Keywords:
Depends on:
Blocks: DOCX-Bullet-Number-Outline-Lists
  Show dependency treegraph
 
Reported: 2022-08-14 17:30 UTC by Andrew Parsons
Modified: 2024-03-19 08:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A .docx document with three multilevel lists; the last has "legal style numbering" applied to its second and third levels. (15.44 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-08-14 17:36 UTC, Andrew Parsons
Details
LO 7.3.5 vs. Word 2016 Comparison (45.52 KB, image/png)
2022-08-15 00:14 UTC, Tex2002ans
Details
isLgl-2.pdf: demonstrating the purpose of isLgl (93.18 KB, application/pdf)
2023-05-18 17:36 UTC, Justin L
Details
isLgl-2.docx: the source demo file - highlighting feature and caveats (20.72 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-05-18 17:46 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Parsons 2022-08-14 17:30:52 UTC
Description:
I work on a team which uses libreoffice CLI to convert .docx files to PDF. We've found that documents drafted in Microsoft Word with the "legal numbering style" applied to list level do not retain the expected Arabic numeral formatting for every enumerated level.

I don't know the exact version of libreoffice used; we use a Docker image based on Ubuntu 20.04 and install the libreoffice package using apt.

To convert `.docx` files to PDF, we run the following:

`soffice --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --nofirststartwizard --convert-to pdf {filename} --outdir {directory}`

Likewise, when opened with LibreOffice Writer 6.0.7.3 on Ubuntu 18.04 (Desktop), a 1.1 will display as 1.a. (please see "Steps to Reproduce", "Actual Results", and "Expected Results").

When examining the numbering.xml file of the document in question, I see <w:isLgl/> tags.

I don't have familiarity with the Office Open XML standard, but I've come across two reference documents:

1. (older, more detailed) https://web.mit.edu/~stevenj/www/ECMA-376-new-merged.pdf
2. (newer, less detailed) MS-OE376 v20171212: https://interoperability.blob.core.windows.net/files/MS-OE376/%5bMS-OE376%5d.pdf

As far as I can tell, this feature corresponds to MS-OE376, Part 4, 2.9.4 isLgl (Display All Levels Using Arabic Numerals).

It appears that libreoffice correctly follows the numer style. However, I interpret `<w:isLgl/>` tag as an override which causes Microsoft Word to ignore the number style and instead apply legal numbering. In this case, I would expect libreoffice/LibreOffice Writer to do the same.

Nota bene: I'm new here. I intentionally styled libreoffice differently from LibreOffice to distinguish, respectively, between the CLI package and the suite of GUI applications. As I'm not familiar with the project, I don't know if that is a reasonable distinction. Please excuse any misconceptions.

Steps to Reproduce:
1. In Microsoft Word, write arbitrary text on two or more lines.
2. Define a new multilevel list style to apply to the text drafted in step (1).
3. Under the "Click level to modify" selector, select the second level.
4. Set the "Number style for this level" to anything except for "1, 2, 3, ...". For example, set level two to "a, b, c, ..."
5. Check the "Legal style numbering" box; this should disable ("grey out") the "Number style for this level" drop-down menu.
6. For added effect, repeat steps (3), (4), and (5) for the third level; set its number style to something like lowercase Roman numerals ("i, ii, iii, ...") and apply "Legal style numbering".
7. Save the document as a `.docx`.
8. Open the document in LibreOffice. Observe that LibreOffice respects the number format and not the legal styling.

Actual Results:
LibreOffice respects the number format and not the legal number styling. The isLgl tag is not applied.

(from numbering.xml)

<w:numFmt w:val="lowerLetter"/>
<w:isLgl/>

<w:numFmt w:val="lowerRoman"/>
<w:isLgl/>

Expected Results:
The isLgl tag should override numFmt.

(from numbering.xml)

<w:numFmt w:val="lowerLetter"/>
<w:isLgl/>

<w:numFmt w:val="lowerRoman"/>
<w:isLgl/>


Reproducible: Always


User Profile Reset: No



Additional Info:
Nothing to add at the moment.
Comment 1 Andrew Parsons 2022-08-14 17:36:15 UTC
Created attachment 181769 [details]
A .docx document with three multilevel lists; the last has "legal style numbering" applied to its second and third levels.
Comment 2 Tex2002ans 2022-08-15 00:14:48 UTC
Created attachment 181777 [details]
LO 7.3.5 vs. Word 2016 Comparison

I confirm the bug:

Version: 7.3.5.2 (x64) / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

- - -

Attached is an image showing the difference in list numbering between LO + Microsoft Word.

Word 2016:

- 1.
-- 1.1.
--- 1.1.1
- 2.
-- 2.1.
--- 2.1.1.

LO 7.3.5:

- 1.
-- 1.a.    <--- Here
--- 1.a.i. <--- Here
- 2.
-- 2.a.    <--- Here
--- 2.a.i. <--- Here

- - -

Other discussion originally happened in this Reddit post:

https://www.reddit.com/r/libreoffice/comments/wmwlf1/does_libreoffices_cli_support_islgl_legal/
Comment 3 Justin L 2023-05-18 17:36:06 UTC
Created attachment 187379 [details]
isLgl-2.pdf: demonstrating the purpose of isLgl

That was an excellent bug report. THANK-YOU.

However, the example document wasn't the best, because it did not display the intention of IsLegal, nor the caveat conditions.

This is something that MUST be handled at display time - and it is a capability that LO currently does not have.
Comment 4 Justin L 2023-05-18 17:46:23 UTC
Created attachment 187380 [details]
isLgl-2.docx: the source demo file - highlighting feature and caveats

There were two caveats mentioned in the "short documentation".
A) it applies to all levels (not just previous levels)
  A.One becomes 1.1, not 1.One.
B) it does not apply to NONE levels
  _.One becomes 1, not 1.1

Notice that it does not affect prior (or future) levels themselves.
   A) remains A) and doesn't become 1)
      1.1) is the only level with isLgl, so it is the only level affected.
          A.One.1) does not becomes 1.1.1)
Comment 5 Justin L 2023-05-18 17:53:58 UTC
Please note that my "discussion examples" are not based on isLgl-2.docx.
Both are separate (although they do highlight the same principles).
Comment 6 Commit Notification 2023-07-11 12:02:27 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fd64b426bc6175841143714ccc16bad181fd088f

tdf#150408: Implement "Legal" numbering (all levels using Arabic numbers)

It will be available in 24.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 7 Commit Notification 2023-07-11 12:04:29 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b13a7112d89b402b41640a19f55ad9edb6433592

tdf#150408: Implement UI for "Legal" numbering

It will be available in 24.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 8 Commit Notification 2024-02-27 08:40:05 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a73b3994fb6a2cc10b2d65cbaad201762610cecc

Related: tdf#150408 DOC filter: handle legal numbering

It will be available in 24.8.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 9 Commit Notification 2024-02-28 08:59:23 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e8487bedb20a429565b4a0e4bd2d6806cc603b7f

Related: tdf#150408 RTF filter: handle legal numbering

It will be available in 24.8.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 10 Commit Notification 2024-03-07 11:07:39 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/58b5f3399e1c4ce56180cb49c5d228ca92ccc8d3

Related: tdf#150408 DOC filter: handle legal numbering

It will be available in 24.2.2.

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 11 TheaBonnett 2024-03-19 08:48:37 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e8487bedb20a429565b4a0e4bd2d6806cc603b7f

Related: tdf#150408 RTF filter: handle legal numbering

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ https://supplementlast.com/ 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.