Skip to content
Permalink
Browse files

Fixes #13999: feature count on rule based renderer is valid for ELSE …

…statement
  • Loading branch information
pblottiere committed Mar 27, 2018
1 parent 0b5c2ae commit 58b3e2005444898aa02070ac4ebebe15d79b18a1
Showing with 22 additions and 1 deletion.
  1. +22 −1 src/core/symbology/qgsrulebasedrenderer.cpp
@@ -553,7 +553,9 @@ bool QgsRuleBasedRenderer::Rule::willRenderFeature( QgsFeature &feat, QgsRenderC
lst.removeOne( rule );

if ( lst.empty() )
{
return true;
}
}
else if ( !rule->isElse( ) && rule->willRenderFeature( feat, context ) )
{
@@ -587,7 +589,26 @@ QSet<QString> QgsRuleBasedRenderer::Rule::legendKeysForFeature( QgsFeature &feat

Q_FOREACH ( Rule *rule, mActiveChildren )
{
lst.unite( rule->legendKeysForFeature( feat, context ) );
bool validKey = false;
if ( rule->isElse() )
{
RuleList lst = rulesForFeature( feat, context, false );
lst.removeOne( rule );

if ( lst.empty() )
{
validKey = true;
}
}
else if ( !rule->isElse( ) && rule->willRenderFeature( feat, context ) )
{
validKey = true;
}

if ( validKey )
{
lst.unite( rule->legendKeysForFeature( feat, context ) );
}
}
return lst;
}

0 comments on commit 58b3e20

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