We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8284300 commit 42d57d6Copy full SHA for 42d57d6
src/core/qgslabel.cpp
@@ -65,12 +65,8 @@ QgsLabel::~QgsLabel()
65
66
QString QgsLabel::fieldValue( int attr, QgsFeature &feature )
67
{
68
- if ( mLabelFieldIdx[attr] == -1 )
69
- {
70
- return QString();
71
- }
72
-
73
- return feature.attribute( attr ).toString();
+ int idx = mLabelFieldIdx[attr];
+ return idx < 0 ? QString() : feature.attribute( idx ).toString();
74
}
75
76
void QgsLabel::renderLabel( QgsRenderContext &renderContext,
0 commit comments