[QGIS Commit] r9930 - branches/Version-1_0/src/core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Jan 6 06:29:48 EST 2009
Author: mhugent
Date: 2009-01-06 06:29:47 -0500 (Tue, 06 Jan 2009)
New Revision: 9930
Modified:
branches/Version-1_0/src/core/qgslabel.cpp
Log:
backport of bugfix for #1467 to 1.0 branch
Modified: branches/Version-1_0/src/core/qgslabel.cpp
===================================================================
--- branches/Version-1_0/src/core/qgslabel.cpp 2009-01-06 11:12:53 UTC (rev 9929)
+++ branches/Version-1_0/src/core/qgslabel.cpp 2009-01-06 11:29:47 UTC (rev 9930)
@@ -700,13 +700,18 @@
{
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;
}
}
More information about the QGIS-commit
mailing list