Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
backport of bugfix for #1467 to 1.0 branch
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@9930 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 6, 2009
1 parent ef40a8a commit d0309c3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/core/qgslabel.cpp
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 d0309c3

Please sign in to comment.