Skip to content

Commit 87a8e8d

Browse files
author
mhugent
committedJan 7, 2009
Use local aware comparison for sorting in attribute table
git-svn-id: http://svn.osgeo.org/qgis/trunk@9934 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b6f51c3 commit 87a8e8d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/app/qgsattributetable.cpp‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
241241
{
242242
if ( alphanumeric )
243243
{
244-
if ( s1 > s2 )
244+
int compareValue = QString::localeAwareCompare(s1, s2);
245+
if ( compareValue > 0 )
245246
{
246247
if ( ascending )
247248
{
@@ -252,7 +253,7 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
252253
return -1;
253254
}
254255
}
255-
else if ( s1 < s2 )
256+
else if ( compareValue < 0 )
256257
{
257258
if ( ascending )
258259
{
@@ -263,7 +264,7 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
263264
return 1;
264265
}
265266
}
266-
else if ( s1 == s2 )
267+
else if ( compareValue = 0 )
267268
{
268269
return 0;
269270
}

0 commit comments

Comments
 (0)
Please sign in to comment.