Skip to content

Commit 42d57d6

Browse files
committedJul 10, 2013
fix old labeling (fixes #8030)
1 parent 8284300 commit 42d57d6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed
 

‎src/core/qgslabel.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,8 @@ QgsLabel::~QgsLabel()
6565

6666
QString QgsLabel::fieldValue( int attr, QgsFeature &feature )
6767
{
68-
if ( mLabelFieldIdx[attr] == -1 )
69-
{
70-
return QString();
71-
}
72-
73-
return feature.attribute( attr ).toString();
68+
int idx = mLabelFieldIdx[attr];
69+
return idx < 0 ? QString() : feature.attribute( idx ).toString();
7470
}
7571

7672
void QgsLabel::renderLabel( QgsRenderContext &renderContext,

0 commit comments

Comments
 (0)
Please sign in to comment.