Bug 156598 - Custom list numbering from DOCX import is not available in UI
Summary: Custom list numbering from DOCX import is not available in UI
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Styles-List
  Show dependency treegraph
 
Reported: 2023-08-03 19:10 UTC by Regina Henschel
Modified: 2023-12-05 13:11 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
custom heading numbering (22.95 KB, application/zip)
2023-08-03 19:10 UTC, Regina Henschel
Details
New kind with format string with no prefix, suffix, display-levels attributes (23.01 KB, application/vnd.oasis.opendocument.text)
2023-08-23 10:14 UTC, Regina Henschel
Details
Mockup (48.87 KB, image/png)
2023-09-06 13:28 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-08-03 19:10:59 UTC
Created attachment 188751 [details]
custom heading numbering

Open attached file. It has for Heading2 a custom numbering style. It is w:lvlText="%1—%2" in OOXML. That is saved to odt as loext:num-list-format="%1%—%2%" and is available to macros with the ListFormat property in NumberingLevel service. But there exist no UI to define or alter such numbering definition.

In ODF 1.4 this kind of numbering style will be available. But it is not necessary to wait until ODF 1.4 is published to create an UI. At least a design proposal for an UI which considers this kind of style should be made before we perhaps get a tender about list numbering.

The new way to define a numbering styles solves some older requests, e.g. bug 67986, bug 115679 or bug 125993.
Comment 1 Heiko Tietze 2023-08-21 12:13:56 UTC
Isn't this just the before/after separator?
Comment 2 Regina Henschel 2023-08-21 12:54:25 UTC
(In reply to Heiko Tietze from comment #1)
> Isn't this just the before/after separator?

No, you are now able to change the separator between the levels. So instead of the current default "1.2" you can define "1-2", for example.
Comment 3 Heiko Tietze 2023-08-21 14:05:14 UTC
Right, it is <before><level><level...><after> and becomes now <before><level><level...><mid><level><after> (assuming the mid separator comes before the last item). Like 1., 1.1, 1.1-1. Correct?
Comment 4 Regina Henschel 2023-08-23 10:14:14 UTC
Created attachment 189104 [details]
New kind with format string with no prefix, suffix, display-levels attributes

(In reply to Heiko Tietze from comment #3)
> Right, it is <before><level><level...><after> and becomes now
> <before><level><level...><mid><level><after> (assuming the mid separator
> comes before the last item). Like 1., 1.1, 1.1-1. Correct?

Prefix and suffix are included in the format string. If the new way is present, then prefix and suffix in the file markup are ignored. They are only written out to file markup for better backward compatibility.

There is no automatic separator in-between. For to get the old display way, the dot needs to be explicitly set in the format string.

Example for level 3
old style:num-prefix="Abschnitt ", style:num-suffix=".", text:display-levels="2"
becomes
loext:num-list-format="Abschnitt %2%.%3%."
Comment 5 Heiko Tietze 2023-09-06 13:28:30 UTC
Created attachment 189389 [details]
Mockup

The mockup follows the current dialog workflow at

(1) and allows to set a string before and after the current level number; effectively this generates <before>%<after> depending on the chosen level. It requires (or allows) to define the string for every single level, which might be tedious. So with

(2) "All" (being some kind of replacement for 1-10) one creates <before>%1<after><before>%2<after><before>%3<after>.... During the design session we pondered over a "Apply to all" button at the before/after fields that allows more fine-grained copying but simplicity first.
In contrast to the current list of levels at the left-most column, the design puts the selection into a dropdown and introduces at

(3) a list of schemes with a couple of predefined options to cover most use cases and to illustrate the capabilities but also allowing to extend with user-defined setups.

We also discussed how to achieve the current separators. This should be possible by adding a "before" string for the first level and something for "after" at the last. "Last" needs to be fix, however. And if more flexibility is needed, the start/end labels could be made available in the dialog too.

Last but not least we should consider some advanced definition like to "%1{.%2}[2-]{.%3}[3-]{.%4}[4-]{.%5}[5-]{.%6}[6-]{.%7}[7-]{.%8}[8-]{.%9}[9-]{.%10}[10-]".
Comment 6 Heiko Tietze 2023-09-07 08:16:39 UTC
(In reply to Heiko Tietze from comment #5)
> ... if more flexibility is needed, 
> the start/end labels could be made available in the dialog too.

We have the option "Numbering followed by" under Position which could be enhanced too.
Comment 7 Heiko Tietze 2023-12-05 13:11:11 UTC
Mockup is available, removing needsUXEval. Happy to revise if the solution needs to be down-scaled.