Bug 123919 - Sorting of user-defined document properties uses US-ASCII ordering (it seems)
Summary: Sorting of user-defined document properties uses US-ASCII ordering (it seems)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium minor
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks: File-Properties
  Show dependency treegraph
 
Reported: 2019-03-07 07:59 UTC by Ulrich Windl
Modified: 2021-08-03 22:41 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Windl 2019-03-07 07:59:22 UTC
Individual entries in the user-defined document properties appear to be sorted incorrectly (I suspect in US-ASCII order).
For Example: 'Ä' follows 'Z'.

See also enhancement request in Bug 123918.
Comment 1 Ulrich Windl 2019-03-07 08:02:36 UTC
In the dialog to insert such user-defined field values, the ordering is correct ('Z' follows 'Ä'), however.
Comment 2 raal 2019-03-11 08:29:09 UTC
confirm with Version: 6.3.0.0.alpha0+
Build ID: 732d630c3d2a168c725c18e4dd8df7a0a4f85566
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 

and Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 3 Thomas Lendo 2019-03-12 19:42:15 UTC
Would be really good to have a more logical order for non-English users.

As an example: user Jeeped described it in the following MS help comment: https://answers.microsoft.com/en-us/msoffice/forum/all/excel-sorting-is-not-in-ascii-order/36a6d145-89e5-44b9-b0c4-e49c92135808 (see also his linked Excel file with a sort order)

"The soft order that Excel uses has to do with language. If a strict ASCII code ordinal was used, a lower case a would come after the upper case Z and several special characters. When Excel sorts alphabetic strings, all of the following characters come before a B,
A a ª Á á À à Â â Ä ä Ã ã Å å Æ æ
... which makes more sense when sorting alphabetic strings in a multilingual product. ..."
Comment 4 QA Administrators 2021-03-12 04:24:38 UTC Comment hidden (obsolete)
Comment 5 Ulrich Windl 2021-03-12 08:58:00 UTC
(Bugs don't go away without action)
I reproduced in 7.0.4.2:
(Nonsense) Properties were sorted in this order:
Arbeit
Blutspende
Ärger
Überfluß
---
So the 'B' is definitely mis-ordered!
Comment 6 Andreas Heinisch 2021-05-17 19:07:15 UTC
Should the sorting only be done in the UI or even for the properties stored in the document itself?
Comment 7 Ulrich Windl 2021-05-18 05:56:52 UTC
As I think sorting at the UI level is helping the user performance, while sorting at the XML level might help the code performance (binary searching), UI level is considered sufficient, especially when considering that some future version might allow sorting the (name, value) pairs by value, too
Comment 8 Andreas Heinisch 2021-05-19 07:49:08 UTC
Proposed patch: https://gerrit.libreoffice.org/c/core/+/115780

However, this change sorts the custom properties only after the opening of the dialog. After adding all your prefered document properties, you have to reopen the dialog in order to get them sorted.

This can be extended to the add property functionality. So after inserting a new property and hitting the "Add property" button again, the list will be sorted. Imho this is not needed, because with a lot of document properties, the user may scroll in order to find the newly added item. Opinions?
Comment 9 Commit Notification 2021-08-03 22:38:24 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4d5c96be4362902144c83708f40f77766244ca06

tdf#123919 - Sort custom document properties

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.