Skip to content

Commit

Permalink
Use case insensitive comparison for column names. Fixes #3298
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14932 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 16, 2010
1 parent 2785c5e commit c39235a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/qgssearchtreenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ QgsSearchTreeValue QgsSearchTreeNode::valueAgainst( const QgsFieldMap& fields, Q
QgsFieldMap::const_iterator it;
for ( it = fields.begin(); it != fields.end(); it++ )
{
if ( it->name().toLower() == mText.toLower() ) // TODO: optimize
if ( QString::compare( it->name(), mText, Qt::CaseInsensitive ) == 0 )
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectordataprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ int QgsVectorDataProvider::fieldNameIndex( const QString& fieldName ) const

for ( QgsFieldMap::const_iterator it = theFields.constBegin(); it != theFields.constEnd(); ++it )
{
if ( it->name() == fieldName )
if ( QString::compare( it->name(), fieldName, Qt::CaseInsensitive ) == 0 )
{
return it.key();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4720,7 +4720,7 @@ int QgsVectorLayer::fieldNameIndex( const QString& fieldName ) const

for ( QgsFieldMap::const_iterator it = theFields.constBegin(); it != theFields.constEnd(); ++it )
{
if ( it->name() == fieldName )
if ( QString::compare( it->name(), fieldName, Qt::CaseInsensitive ) == 0 )
{
return it.key();
}
Expand Down

0 comments on commit c39235a

Please sign in to comment.