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@9934 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 7, 2009
1 parent b6f51c3 commit 87a8e8d
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 ( s1 > s2 )
int compareValue = QString::localeAwareCompare(s1, s2);
if ( compareValue > 0 )
{
if ( ascending )
{
Expand All @@ -252,7 +253,7 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
return -1;
}
}
else if ( s1 < s2 )
else if ( compareValue < 0 )
{
if ( ascending )
{
Expand All @@ -263,7 +264,7 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
return 1;
}
}
else if ( s1 == s2 )
else if ( compareValue = 0 )
{
return 0;
}
Expand Down

0 comments on commit 87a8e8d

Please sign in to comment.