Natural Sort to ODF

Regina Henschel rb.henschel at t-online.de
Thu Aug 21 10:46:29 UTC 2025


Hi all,

LibreOffice can sort texts in "natural sort" kind in database ranges in 
Calc. That is an order K1, K2, K14, K107 instead of the alphanumeric 
order K1, K107, K14, K2. But LibreOffice does not write/read to ODF, 
that a database range uses this kind of sorting. I want to implement this.

Problem A: The according ODF attribute is table:embedded-number-behavior 
(19.628, part 3 ODF 1.4).
https://docs.oasis-open.org/office/OpenDocument/v1.4/cs01/part3-schema/OpenDocument-v1.4-cs01-part3-schema.html#attribute-table_embedded-number-behavior
It has the values 'alpha-numeric', 'double', and 'integer'.

The according LibreOffice attribute in core is
bool bNaturalSort
in struct ScSortParam.

Thus ODF has three kinds and LO has two kinds.
 From my tests I guess, that bNaturalSort=true corresponds to value 
'double'.

Problem B: There exists no UNO property for natural sort.
Can I simply add it to css.sheet.SheetSortDescriptor2? As boolean or as 
enum?

What do you suggest?

Kind regards,
Regina


More information about the LibreOffice mailing list