Skip to content
Permalink
Browse files

Use local aware comparison for sorting in attribute table

git-svn-id: http://svn.osgeo.org/qgis/trunk@9934 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jan 7, 2009
1 parent b6f51c3 commit 87a8e8d86c7e83d1a464dd9483c2ba1bd22ed9a2
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 87a8e8d

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