Skip to content

Commit

Permalink
Use local aware comparison for sorting in attribute table
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9934 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 7, 2009
1 parent 25fb2f1 commit af7dc44
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/qgsattributetable.cpp
Expand Up @@ -241,7 +241,8 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
{ {
if ( alphanumeric ) if ( alphanumeric )
{ {
if ( s1 > s2 ) int compareValue = QString::localeAwareCompare(s1, s2);
if ( compareValue > 0 )
{ {
if ( ascending ) if ( ascending )
{ {
Expand All @@ -252,7 +253,7 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
return -1; return -1;
} }
} }
else if ( s1 < s2 ) else if ( compareValue < 0 )
{ {
if ( ascending ) if ( ascending )
{ {
Expand All @@ -263,7 +264,7 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
return 1; return 1;
} }
} }
else if ( s1 == s2 ) else if ( compareValue = 0 )
{ {
return 0; return 0;
} }
Expand Down

0 comments on commit af7dc44

Please sign in to comment.