Skip to content

Commit

Permalink
Do not show in composer legend unused layers if filtering by map is e…
Browse files Browse the repository at this point in the history
…nabled

This resolves #11457 and partially #11293
  • Loading branch information
wonder-sk committed Oct 24, 2014
1 parent 6bde8a2 commit 4ac94f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/qgslegendrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ QList<QgsLegendRenderer::Atom> QgsLegendRenderer::createAtomList( QgsLayerTreeGr

QList<QgsLayerTreeModelLegendNode*> legendNodes = mLegendModel->layerLegendNodes( nodeLayer );

// workaround for the issue that "filtering by map" does not remove layer nodes that have no symbols present
// on the map. We explicitly skip such layers here. In future ideally that should be handled directly
// in the layer tree model
if ( legendNodes.isEmpty() && mLegendModel->legendFilterByMap() )
continue;

QList<Atom> layerAtoms;

for ( int j = 0; j < legendNodes.count(); j++ )
Expand Down

0 comments on commit 4ac94f2

Please sign in to comment.