Skip to content
Permalink
Browse files

Use local aware comparison for sorting in attribute table

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9934 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jan 7, 2009
1 parent 25fb2f1 commit af7dc44cf12fc2a4d12fc114dab891cb72277bba
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/app/qgsattributetable.cpp
@@ -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 )
{
@@ -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 )
{
@@ -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;
}

0 comments on commit af7dc44

Please sign in to comment.
You can’t perform that action at this time.