More questions on Lists

Hi Team, Regina

Is it correct to state the following:

1) A list is set of paragraphs, labeled with the same ListID.

2) All paragraphs with same ListID belongs to the same list, independent of the paragraph style.

3) A paragraph with no ListID (ListID="") does not belongs to a list.

4) The List style defines an unique ListID in the document, in the form of ListID="listNNNNNNNNNNN" where NNN... is a random but unique number in the document.

5) removing the numbering or bullet from the paragraph does not remove the paragraph from the list.

(In LibreOffice 7.2 the listID can be inpected wither in the Styles Inspector and the UNO object inspector)

Thanks for the clarifications.
Kind regards

Hi Olivier,

Hi Team, Regina

I can describe the problem from the point of view of the file format. For questions about the internal handling of lists, Michel Stahl is certainly the more appropriate contact.

Is it correct to state the following:

1) A list is set of paragraphs, labeled with the same ListID.

The concept of "numbered paragraph" from ODF 1.1 is deprecated since ODF 1.2. and will be removed in ODF 1.4. I think it was never supported in OpenOffice.org or LibreOffice.

Now a list is always a structure. It is a <test:list> element in file format. It has child elements <text:list-item> and <text:list-header>. A <text:list-header> is essentially the same as a <text:list-item> only that it is not numbered.

A <text:list-item> can contain paragraphs (including headings) and <text:list> elements. This sub-list is then the next list level.

The first paragraph in a <list:item> gets the number/bullet/image. Formally it is possible to directly start a list item with a sub-list, but LibreOffice confuses the numbering then. So in LibreOffice a list item must start with a paragraph.

The UI generates good structures only in Writer. Lists in Impress are bad structured and the UI is no help there.

2) All paragraphs with same ListID belongs to the same list, independent of the paragraph style.

Neither list item nor paragraph have a list ID at all, but only the list itself. The fact, that a paragraph belongs to a list is given only by the structure in the file format.

A list does not need to have a list ID. Such list ID is not used in Impress, for example.

3) A paragraph with no ListID (ListID="") does not belongs to a list.

see 2), paragraph never have list IDs.

4) The List style defines an unique ListID in the document, in the form of ListID="listNNNNNNNNNNN" where NNN... is a random but unique number in the document.

A list style itself does not define a list ID. But if you assign a list style, then LibreOffice generates a list ID for the list if necessary. A list ID is a standard xml:id attribute, which implies its uniqueness. From point of file format it need not start with the text "list", but it may be other another text.

A list ID is necessary, if you have a document structure

paragraphs
list A
paragraphs
list B
paragraphs
list A, continued

Then you need to set the value of attribute text:continue-list in the second part of list A to the list ID of the first part.

But it seems LibreOffice sets a list ID for all outermost lists in Writer.

For a structure

paragraphs
list A
paragraphs
list A, continued

LibreOffice does not use the text:continue-list but the weaker attribute text:continue-numbering, which refers to the previous list.

5) removing the numbering or bullet from the paragraph does not remove the paragraph from the list.

If you use backspace to remove the numbering/bullet/image, then LibreOffice turns the item into a <text:list-header> element.

The handling is not ODF-conform, but does not produce validator errors. The description in ODF is "It contains one or more paragraphs that are displayed before a list." But they are not displayed before the list but within the other list items in LibreOffice.

Nevertheless you are right, the paragraph still belongs to the list.

(In LibreOffice 7.2 the listID can be inpected wither in the Styles Inspector and the UNO object inspector)

The Styles Inspector is wrong, that is lists 'List Id' and 'List Label String' in the category 'Character Direct Formatting'. Both are not a character formatting. The 'List Id' is not even a 'Style' but an attribute of the list. You have <test:list xml:id="list123456"> for example. Whereas the 'List Label String' is defined in a <text:list-style> element, which is referenced by the text:style-name attribute of the list. Whereby the resulting string is not contained in the file but generated by the application.

The API is more correct. About 'listId' it states "specifies the id of the list to which the paragraph belongs". About 'ListLabelString' it states "allows reading the generated numbering list label."

Kind regards
Regina