Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #592 from matthias-kuhn/fix-7405
[Fix #7405] Graduated renderer: Feature count 0 with scale or rotation
  • Loading branch information
mhugent committed May 16, 2013
2 parents 36bf93c + b7ef48a commit 2c7eff7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -635,10 +635,9 @@ QgsLegendSymbolList QgsCategorizedSymbolRendererV2::legendSymbolItems()
lst << qMakePair( classAttribute(), ( QgsSymbolV2* )0 );
}

QgsCategoryList::const_iterator catIt = mCategories.constBegin();
for ( ; catIt != mCategories.constEnd(); ++catIt )
foreach ( const QgsRendererCategoryV2& cat, mCategories )
{
lst << qMakePair( catIt->label(), catIt->symbol() );
lst << qMakePair( cat.label(), cat.symbol() );
}
return lst;
}
Expand Down
14 changes: 11 additions & 3 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -1076,10 +1076,18 @@ QgsLegendSymbolList QgsGraduatedSymbolRendererV2::legendSymbolItems()
lst << qMakePair( classAttribute(), ( QgsSymbolV2* )0 );
}

QgsRangeList::const_iterator rangeIt = mRanges.constBegin();
for ( ; rangeIt != mRanges.constEnd(); ++rangeIt )
foreach ( const QgsRendererRangeV2& range, mRanges )
{
lst << qMakePair( rangeIt->label(), rangeIt->symbol() );
QgsSymbolV2* symbol;
if ( mRotationFieldIdx == -1 && mSizeScaleFieldIdx == -1 )
{
symbol = range.symbol();
}
else
{
symbol = mTempSymbols[range.symbol()];
}
lst << qMakePair( range.label(), symbol );
}
return lst;
}
Expand Down

0 comments on commit 2c7eff7

Please sign in to comment.