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@9929 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 6, 2009
1 parent a182250 commit 6f552ec
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 6f552ec

Please sign in to comment.