https://bugs.documentfoundation.org/show_bug.cgi?id=94660

--- Comment #5 from Robert Lacroix <[email protected]> ---
There is a bug here, but it's not what the OP thinks it is.
The bug is: autofilter overwrites the sort range's descriptor.

The OP wants the natural sort order, but that's not available through
autofilter. So we sort the range with options and then add Autofilter. The
problem is that Autofilter, when actually applied, overwrites the sort order
option set in the sort range's descriptor.

1) Open a new Calc document and enter the OP's data into a column of cells
along with a heading row of "data", but we scramble the data a bit to confirm
that the sort is happening.
Our cell contents are:
data
aaa2004
aaa_2006
aaa_2005

2) Select the range including the heading and sort it with options:
2a) Select the range including the title
2b) Choose Data menu > Sort...
2c) Choose Sort dialog Options tab
2d) Check "Range includes column labels"
2e) Check "Enable natural sort"
2f) Click OK

The data is now sorted as the OP wants. Our cell contents are:
data
aaa2004
aaa_2005
aaa_2006

3) With the range still selected, choose Data menu > Autofilter
Autofilter sees that the range has a column heading set by the sort range's
descriptor and does not ask whether to use the first row as a heading. This is
good. The range's heading cell now acquires the Autofilter dropdown menu
button, but nothing will happen to the data until the Autofilter option is
exercised, which we will do in step 5.

4) With the range still selected, confirm that sort options are still set.
2a) Choose Data menu > Sort...
2b) Choose Sort dialog Options tab
2c) See that the column labels and natural sort options are still checked
2d) Click Cancel

5) Sort the range using the Autofilter's dropdown menu button in the heading.
5a) Click the downward pointing triangle in the heading cell
5b) Click Sort Ascending

Notice that the data is now sorted as the OP's complains, not the natural
order.

6) With the heading row still selected, verify sort options once again.
6a) Choose Data menu > Sort...
6b) Choose Sort dialog Options tab
6c) See that the column label is still checked but the natural sort is now
unchecked.
2d) Click Cancel

Step 6 shows that the Autofilter sorting action overwrites the sort descriptor.
The Sort Ascending and Sort Descending UI buttons and corresponding menu
options are even more egregious, wiping out the entire sort descriptor
including the column heading. Is this by design? I think not.

As far as the default sort order, I find no fault in LO Calc's choice.

Unicode Technical Standard #10 UNICODE COLLATION ALGORITHM
https://www.unicode.org/reports/tr10/

declares as the basic principle:

"The position of characters in the Unicode code charts does not specify their
sort order."

The meaning of "Unicode order" is thus utterly ambiguous because code points
collate in different orders for different languages. However, taking the cue of
"unix ls" as the OP's desired sort order, the "Enable natural sort" option
should be selected by the OP. The default sort order used by LO is in fact the
start of the Unicode code set, where the first 127 characters copies the 7-bit
ASCII code: punctuation precedes digits which precedes alphabetic characters.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to