Skip to content
Permalink
Browse files

Legend: leave away empty groups (fix #12969)

(cherry-picked from c78347)
  • Loading branch information
mhugent authored and nyalldawson committed Jul 6, 2016
1 parent 586e14c commit 269db1466e8850b9a3f5ef8d02d8efd1c365c67a
@@ -161,6 +161,7 @@ QList<QgsLegendRenderer::Atom> QgsLegendRenderer::createAtomList( QgsLayerTreeGr

// Group subitems
QList<Atom> groupAtoms = createAtomList( nodeGroup, splitLayer );
bool hasSubItems = groupAtoms.size() > 0;

if ( nodeLegendStyle( nodeGroup ) != QgsComposerLegendStyle::Hidden )
{
@@ -188,7 +189,12 @@ QList<QgsLegendRenderer::Atom> QgsLegendRenderer::createAtomList( QgsLayerTreeGr
groupAtoms.append( atom );
}
}
atoms.append( groupAtoms );

if ( hasSubItems ) //leave away groups without content
{
atoms.append( groupAtoms );
}

}
else if ( QgsLayerTree::isLayer( node ) )
{
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 269db14

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