Skip to content

Commit

Permalink
QgsLayoutLegendWidget::mLayerExpressionButton_clicked(): remove usele…
Browse files Browse the repository at this point in the history
…ss nullptr check
  • Loading branch information
rouault committed Jun 1, 2020
1 parent 1030a31 commit 2081e0d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/gui/layout/qgslayoutlegendwidget.cpp
Expand Up @@ -1118,11 +1118,8 @@ void QgsLayoutLegendWidget::mLayerExpressionButton_clicked()
symbolLegendScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_label" ), legendNode.symbolLabel().remove( QStringLiteral( "[%" ) ).remove( QStringLiteral( "%]" ) ), true ) );
symbolLegendScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_id" ), legendSymbols.first().ruleKey(), true ) );
highlighted << QStringLiteral( "symbol_label" ) << QStringLiteral( "symbol_id" );
if ( vl )
{
symbolLegendScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_count" ), QVariant::fromValue( vl->featureCount( legendSymbols.first().ruleKey() ) ), true ) );
highlighted << QStringLiteral( "symbol_count" );
}
symbolLegendScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_count" ), QVariant::fromValue( vl->featureCount( legendSymbols.first().ruleKey() ) ), true ) );
highlighted << QStringLiteral( "symbol_count" );
}
}

Expand Down

0 comments on commit 2081e0d

Please sign in to comment.