Skip to content

Commit

Permalink
[Fix #7405] Graduated renderer: Feature count 0 with scale or rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 15, 2013
1 parent d64ee56 commit b7ef48a
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 b7ef48a

Please sign in to comment.