Skip to content
Permalink
Browse files

QgsLayoutLegendWidget::mLayerExpressionButton_clicked(): remove usele…

…ss nullptr check
  • Loading branch information
rouault committed Jun 1, 2020
1 parent 1030a31 commit 2081e0d891bae385efe0f45c22261d33b887fcfe
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/gui/layout/qgslayoutlegendwidget.cpp
@@ -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" );
}
}

0 comments on commit 2081e0d

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