Hi all,
ODF has three types of 'embedded-number-behavior' [1] for sorting of
text in database-range:
'alpha-numeric': Embedded numbers are treated as ordinary characters.
'double': A part of the text, that could be a number is treated as
number. Such number may be a decimal number with decimal separator. That
is the current sorting in LibreOffice, when "Enable natural sort" option
is checked in Data > Sort > Options.
'integer': A part of the text, that could be a number is treated as
number. Decimal separators thereby are always treated as ordinary
characters. That is currently not implemented.
LibreOffice uses currently in core the struct ScSortParam with component
bool bNaturalSort
with meaning false='alpha-numeric' and true='double'.
I want to implement the third case 'integer'. For that I need to
extend/change this struct. I could think of
(A)
Replace bNaturalSort with an enum with three possible values.
(B)
Add an additional boolean component to distinguish between 'double' and
'integer' that is used in case bNaturalSort is true.
What would you prefer?
The API is no problem. It has the constant group SortNumberBehavior with
currently ALPHA_NUMERIC=0 and DOUBLE=1. It will get a third item INTEGER=2.
[1]
https://docs.oasis-open.org/office/OpenDocument/v1.4/cs01/part3-schema/OpenDocument-v1.4-cs01-part3-schema.html#attribute-table_embedded-number-behavior
Kind regards,
Regina