Skip to content

Commit

Permalink
Get the right rule in Categorized and Graduated
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane Brunner committed Oct 19, 2013
1 parent 57b695b commit b1c26bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -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;
}
Expand Down
19 changes: 11 additions & 8 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit b1c26bf

Please sign in to comment.