Skip to content

Commit

Permalink
Fix for loading labels in postgis layers
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9929 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 6, 2009
1 parent 0d65a35 commit 84b74a2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/core/qgslabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,18 @@ bool QgsLabel::readLabelField( QDomElement &el, int attr, QString prefix = "fiel
{
name = el.attribute( name );

int i;
for ( i = 0; i < mField.size() && mField[i].name() != name; i++ )
;
QgsFieldMap::const_iterator field_it = mField.constBegin();
for(; field_it != mField.constEnd(); ++field_it)
{
if(field_it.value().name() == name)
{
break;
}
}

if ( i < mField.size() )
if ( field_it != mField.constEnd() )
{
mLabelFieldIdx[attr] = i;
mLabelFieldIdx[attr] = field_it.key();
return true;
}
}
Expand Down

0 comments on commit 84b74a2

Please sign in to comment.