Skip to content

Commit d0309c3

Browse files
author
mhugent
committedJan 6, 2009
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
1 parent ef40a8a commit d0309c3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

‎src/core/qgslabel.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,18 @@ bool QgsLabel::readLabelField( QDomElement &el, int attr, QString prefix = "fiel
700700
{
701701
name = el.attribute( name );
702702

703-
int i;
704-
for ( i = 0; i < mField.size() && mField[i].name() != name; i++ )
705-
;
703+
QgsFieldMap::const_iterator field_it = mField.constBegin();
704+
for(; field_it != mField.constEnd(); ++field_it)
705+
{
706+
if(field_it.value().name() == name)
707+
{
708+
break;
709+
}
710+
}
706711

707-
if ( i < mField.size() )
712+
if ( field_it != mField.constEnd() )
708713
{
709-
mLabelFieldIdx[attr] = i;
714+
mLabelFieldIdx[attr] = field_it.key();
710715
return true;
711716
}
712717
}

0 commit comments

Comments
 (0)
Please sign in to comment.