Skip to content
Permalink
Browse files

Also render all parent features on refined rules

Fix #13708
  • Loading branch information
m-kuhn committed Jan 18, 2016
1 parent 433e3b8 commit d796ade35d6dd95d23d3f1f5edbb817718f0d140
Showing with 12 additions and 10 deletions.
  1. +12 −10 src/core/symbology-ng/qgsrulebasedrendererv2.cpp
@@ -36,9 +36,13 @@


QgsRuleBasedRendererV2::Rule::Rule( QgsSymbolV2* symbol, int scaleMinDenom, int scaleMaxDenom, const QString& filterExp, const QString& label, const QString& description, bool elseRule )
: mParent( nullptr ), mSymbol( symbol )
, mScaleMinDenom( scaleMinDenom ), mScaleMaxDenom( scaleMaxDenom )
, mFilterExp( filterExp ), mLabel( label ), mDescription( description )
: mParent( nullptr )
, mSymbol( symbol )
, mScaleMinDenom( scaleMinDenom )
, mScaleMaxDenom( scaleMaxDenom )
, mFilterExp( filterExp )
, mLabel( label )
, mDescription( description )
, mElseRule( elseRule )
, mIsActive( true )
, mFilter( nullptr )
@@ -57,20 +61,16 @@ QgsRuleBasedRendererV2::Rule::~Rule()

void QgsRuleBasedRendererV2::Rule::initFilter()
{
if ( mElseRule || mFilterExp.compare( "ELSE", Qt::CaseInsensitive ) == 0 )
if ( mFilterExp.compare( "ELSE", Qt::CaseInsensitive ) == 0 || mFilterExp.trimmed().isEmpty() )
{
mElseRule = true;
mFilter = nullptr;
}
else if ( !mFilterExp.isEmpty() )
else
{
delete mFilter;
mFilter = new QgsExpression( mFilterExp );
}
else
{
mFilter = nullptr;
}
}

void QgsRuleBasedRendererV2::Rule::appendChild( Rule* rule )
@@ -442,11 +442,13 @@ bool QgsRuleBasedRendererV2::Rule::startRender( QgsRenderContext& context, const

if ( isElse() )
{
if ( sf.trimmed().isEmpty() )
if ( mSymbol || sf.trimmed().isEmpty() )
filter = "TRUE";
else
filter = sf;
}
else if ( mSymbol )
filter = mFilterExp;
else if ( !mFilterExp.trimmed().isEmpty() && !sf.trimmed().isEmpty() )
filter = QString( "(%1) AND (%2)" ).arg( mFilterExp, sf );
else if ( !mFilterExp.trimmed().isEmpty() )

0 comments on commit d796ade

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