https://bz.apache.org/ooo/show_bug.cgi?id=97808
hanya <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #5 from hanya <[email protected]> --- In ScTable::Sort method, the default collator can be described in with the following code: Sub DefaultCollator Dim locale as new com.sun.star.lang.Locale locale.Language = "en" locale.Country = "US" op = com.sun.star.i18n.CollatorOptions.CollatorOptions_IGNORE_CASE op = 0 ' case sensitive c = CreateUnoService("com.sun.star.i18n.Collator") n = c.loadDefaultCollator(locale, op) if n = 0 then s = "a, A: " & CStr(c.compareString("a", "A")) & chr(10) s = s & "A, a: " & CStr(c.compareString("A", "a")) & chr(10) s = s & "a, b: " & CStr(c.compareString("a", "b")) & chr(10) s = s & "b, a: " & CStr(c.compareString("b", "a")) & chr(10) msgbox s '1 if the first string is greater than the second string '0 if the first string is equal to the second string '-1 if the first string is less than the second string end if End Sub With case sensitive, cmp(a, A): -1, cmp(A, a): 1, cmp(a, b): -1, cmp(b, a): 1 In QuickSort method, if cmp() > 0, cells are swapped when only two cells are there. cmp(b, a) have to be swapped but cmp(A, a) should not. Its hard to sort with these result of the collator in case sensitive. -- You are receiving this mail because: You are the assignee for the issue. You are on the CC list for the issue.
