Hi all,
it is more complicate than I first thought. Currently the
Sort-transformation of a dataprovider (= element <calcext:data-mapping>)
is not written to file and not loaded (bug tdf#169610).
The fact, that the cell range has a label (header) row does not belong
to the <table:sort> element, but to the <table:database-range> element,
although internal it belongs to the ScSortParam struct.
Thus in case of (A) we cannot use the <table:sort> element, as it is
currently tried, but we need something own for the
<calcext:column-sort-transformation>.
In case of (C) the setting might contradict with the attribute of the
database-range which the <calcext:data-mapping> element refers in its
calcext:database-name attribute.
(B) means, that the information needs to be somehow transported to the
SortTransformation class. Its ctor gets a ScSortParam as parameter, but
at the place of construction, the referred database-range is currently
unknown.
So I'm still unsure about which path to take.
Maybe you have a completely different idea.
Kind regards,
Regina
Regina Henschel schrieb am 25.11.2025 um 20:03:
Hi all,
in my ongoing work to collect the sorting methods in Calc
(https://wiki.documentfoundation.org/Faq/Calc/Sorting_in_Calc) I have
seen the sort transformation in the dialog "Data Provider..." in menu
Data. This transformation has several problems. One of these problems
is, that the user currently cannot determine whether the to be sorted
data has a label row or not.
I can imagine these ways to solve the problem:
(A)
Extend the sort item in the dialog (where you determine
ascending/descending and the index of to be sorted column) by a checkbox
for `my data has a label row`.
(B)
Use the setting of the database range. A database range is mandatory for
a Data Provider.
(C)
In case of a csv-file as source, always treat the first row as label.
Other ideas?
What idea would you prefer?
Kind regards,
Regina