[QGIS Commit] r9771 - trunk/qgis/src/core/symbology

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Dec 11 06:07:51 EST 2008


Author: jef
Date: 2008-12-11 06:07:51 -0500 (Thu, 11 Dec 2008)
New Revision: 9771

Modified:
   trunk/qgis/src/core/symbology/qgssymbol.cpp
Log:
fix #1162

Modified: trunk/qgis/src/core/symbology/qgssymbol.cpp
===================================================================
--- trunk/qgis/src/core/symbology/qgssymbol.cpp	2008-12-10 13:16:59 UTC (rev 9770)
+++ trunk/qgis/src/core/symbology/qgssymbol.cpp	2008-12-11 11:07:51 UTC (rev 9771)
@@ -484,11 +484,11 @@
     const QgsFieldMap &fields = vl.pendingFields();
     QString name = node.toElement().text();
 
-    int i;
-    for ( i = 0; i < fields.size() && fields[i].name() != name; i++ )
-      ;
+    for ( QgsFieldMap::const_iterator it = fields.begin(); it != fields.end(); it++ )
+      if( it->name() == name )
+        return it.key();
 
-    return i < fields.size() ? i : -1;
+    return -1;
   }
 
   node = synode.namedItem( name );



More information about the QGIS-commit mailing list