Skip to content
Permalink
Browse files

Fix for loading labels in postgis layers

git-svn-id: http://svn.osgeo.org/qgis/trunk@9929 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jan 6, 2009
1 parent a182250 commit 6f552ec9e8bf0e130b5fd1c13398e235622abd8d
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/core/qgslabel.cpp
@@ -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;
}
}

0 comments on commit 6f552ec

Please sign in to comment.
You can’t perform that action at this time.