Use locale specific sort comparissons
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18651 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
from wxPython.wx import *
|
||||
import locale
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@@ -105,7 +106,12 @@ class wxColumnSorterMixin:
|
||||
item1 = self.itemDataMap[key1][col]
|
||||
item2 = self.itemDataMap[key2][col]
|
||||
|
||||
#--- Internationalization of string sorting with locale module
|
||||
if type(item1) == type('') or type(item2) == type(''):
|
||||
cmpVal = locale.strcoll(str(item1), str(item2))
|
||||
else:
|
||||
cmpVal = cmp(item1, item2)
|
||||
#---
|
||||
|
||||
# If the items are equal then pick something else to make the sort value unique
|
||||
if cmpVal == 0:
|
||||
|
Reference in New Issue
Block a user