Bug 168917 - Extended tooltip for sorting case sensitive is wrong
Summary: Extended tooltip for sorting case sensitive is wrong
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Olivier Hallot
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Tooltip
  Show dependency treegraph
 
Reported: 2025-10-17 10:38 UTC by Regina Henschel
Modified: 2025-12-01 18:11 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet for testing (11.13 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-10-17 10:38 UTC, Regina Henschel
Details
Screenshot of the tooltip (31.08 KB, image/png)
2025-10-17 10:38 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2025-10-17 10:38:28 UTC
Created attachment 203388 [details]
Spreadsheet for testing

Open attached spreadsheet. Enable extended Tips.
Mark the data and open the sort dialog (e.g. Data > Sort...). Set sort key to "Deutsch" and ascending. Go to tab "Options" and hover the label "Case sensitive" (screenshot will be attached.). Now check this option and look at the result.

The words are ordered so that the lower case variants are before the uppercase variants, in the example alter, Alter, arm, Arm, biss, Biss, floh, Floh. That means, that the tooltip "Sorts first by uppercase letters" is wrong.

In addition, the tooltip reads as if all uppercase and all lowercase words are grouped; in the example as if order was Alter, Arm, Biss, Floh, alter, arm, biss, floh

The help text has the same wrong wording.
Comment 1 Regina Henschel 2025-10-17 10:38:58 UTC
Created attachment 203389 [details]
Screenshot of the tooltip
Comment 2 Regina Henschel 2025-11-05 14:40:57 UTC
I'll fix the wrong wording in the sortoptionspage.ui file together with the fix for bug 168899. Thus this report can be restricted to documentation.
Comment 3 Regina Henschel 2025-11-05 15:22:52 UTC
Proposed change is in https://gerrit.libreoffice.org/c/core/+/193468
Comment 5 Commit Notification 2025-11-06 10:48:24 UTC
Olivier Hallot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/1e66ff8bd5bc9a11551a0b7246b443b992cdccd4

tdf#168917 Sort options includes natural sorting
Comment 6 Regina Henschel 2025-11-09 14:19:50 UTC
Sorry, I was wrong about the order of uppercase and lower case variants. The order is locale dependent. Most locales treat the lower case variant as smaller than the upper case variant, such as 'a' < 'A' < 'b' < 'B' for English(USA). However, at least Danish uses 'A' < 'a' < 'B' < 'b'.

LibreOffice uses directly the ICO collation with ico::Collator::TERTIARY in case of Danish.

I have tried to find whether the ICO collation gives uppercase < lowercase for other locale than Danish (da_DK), but without success.

For the extended tooltip I suggest:

Treats lowercase and uppercase variants of a letter as different characters. For Asian locales, special handling applies.

@Olivier, do you agree? If yes, I'll write the patch for sortoptionspage.ui

For the help perhaps:
Treats lowercase and uppercase variants of a letter as different characters. The order is locale dependent. Most locales treat the lower case variant as smaller than the upper case variant, such as 'a' < 'A' < 'b' < 'B' for English(USA). However, at least Danish uses 'A' < 'a' < 'B' < 'b'.  For Asian locales, special handling applies.

However, the help is your area, thus you decide how to write it there.
Comment 7 Olivier Hallot 2025-11-09 17:47:35 UTC
(In reply to Regina Henschel from comment #6)
> Sorry, I was wrong about the order of uppercase and lower case variants. The
> order is locale dependent. Most locales treat the lower case variant as
> smaller than the upper case variant, such as 'a' < 'A' < 'b' < 'B' for
> English(USA). However, at least Danish uses 'A' < 'a' < 'B' < 'b'.
> 
> LibreOffice uses directly the ICO collation with ico::Collator::TERTIARY in
> case of Danish.
> 
> I have tried to find whether the ICO collation gives uppercase < lowercase
> for other locale than Danish (da_DK), but without success.

Are we actually referencing ICU (International Components for Unicode) instead of ICO? I found this reference for ICU 
https://srl295.github.io/icu/apidoc/released/icu4c/classicu_1_1Collator.html#a82bc20541fe4503fb78644a1968e15a2

Anyway, not a mention on collation for countries/locales so far. Still searching.

> 
> For the extended tooltip I suggest:
> 
> Treats lowercase and uppercase variants of a letter as different characters.
> For Asian locales, special handling applies.
> 
> @Olivier, do you agree? If yes, I'll write the patch for sortoptionspage.ui
> 
> For the help perhaps:
> Treats lowercase and uppercase variants of a letter as different characters.
> The order is locale dependent. Most locales treat the lower case variant as
> smaller than the upper case variant, such as 'a' < 'A' < 'b' < 'B' for
> English(USA). However, at least Danish uses 'A' < 'a' < 'B' < 'b'.  For
> Asian locales, special handling applies.
> 
> However, the help is your area, thus you decide how to write it there.

I think the collation issue is important to document, and get the list of locales affected.
Comment 8 Olivier Hallot 2025-11-09 18:30:52 UTC
Source for collation based on locale:

https://icu4c-demos.unicode.org/icu-bin/collation.html#legend
Comment 9 Regina Henschel 2025-11-09 19:24:44 UTC
(In reply to Olivier Hallot from comment #7)
> Are we actually referencing ICU (International Components for Unicode)
> instead of ICO? I found this reference for ICU 
> https://srl295.github.io/icu/apidoc/released/icu4c/classicu_1_1Collator.
> html#a82bc20541fe4503fb78644a1968e15a2

Yes, LibreOffice uses icu4c-78.1-sources.tgz and icu4c-78.1-data.zip
see https://opengrok.libreoffice.org/xref/core/download.lst

When I set a breakpoint in https://opengrok.libreoffice.org/xref/core/sc/source/core/data/table3.cxx?r=45e8e48301c100e35da4e5da3d643a92ab06ba17#1560
and step in from there, I come to the library in workdir/UnpackedTarball/icu.
Comment 10 Commit Notification 2025-11-11 12:10:34 UTC
Olivier Hallot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/2261a59d701dcc2cf7ed7ea421d6260f404d6fa0

tdf#168917 Precision on Sort options
Comment 11 Commit Notification 2025-11-11 21:52:34 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cf992f9b78a2e618e64bc0173e2bb90d568e1adb

tdf#168917 Sort case-sensitive tooltip improved

It will be available in 26.2.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.