Skip to content
Permalink
Browse files

Get the right rule in Categorized and Graduated

  • Loading branch information
Stéphane Brunner
Stéphane Brunner committed Oct 19, 2013
1 parent 57b695b commit b1c26bf4a43f28079187b29b4139f427ab0d21fe
@@ -649,7 +649,10 @@ QgsLegendSymbolList QgsCategorizedSymbolRendererV2::legendSymbolItems( double sc

foreach ( const QgsRendererCategoryV2& cat, mCategories )
{
lst << qMakePair( cat.label(), cat.symbol() );
if ( rule.isEmpty() || cat.label() == rule )
{
lst << qMakePair( cat.label(), cat.symbol() );
}
}
return lst;
}
@@ -1109,16 +1109,19 @@ QgsLegendSymbolList QgsGraduatedSymbolRendererV2::legendSymbolItems( double scal

foreach ( const QgsRendererRangeV2& range, mRanges )
{
QgsSymbolV2* symbol;
if ( mRotationFieldIdx == -1 && mSizeScaleFieldIdx == -1 )
if ( rule.isEmpty() || range.label() == rule )
{
symbol = range.symbol();
}
else
{
symbol = mTempSymbols[range.symbol()];
QgsSymbolV2* symbol;
if ( mRotationFieldIdx == -1 && mSizeScaleFieldIdx == -1 )
{
symbol = range.symbol();
}
else
{
symbol = mTempSymbols[range.symbol()];
}
lst << qMakePair( range.label(), symbol );
}
lst << qMakePair( range.label(), symbol );
}
return lst;
}

0 comments on commit b1c26bf

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