Skip to content
Permalink
Browse files
[composer] ComposerLegend update all now only applies to referenced m…
…ap's layers (in case they are locked) (fix #7177)
  • Loading branch information
olivierdalang authored and nyalldawson committed Jan 27, 2014
1 parent cac7790 commit 177e5a195249f0ebae68c7a76acebb0fb95b7d36
Showing with 16 additions and 5 deletions.
  1. +16 −5 src/app/composer/qgscomposerlegendwidget.cpp
@@ -888,16 +888,27 @@ void QgsComposerLegendWidget::updateLegend()

//get layer id list
QStringList layerIdList;
QgsMapCanvas* canvas = app->mapCanvas();
if ( canvas )
const QgsComposerMap* linkedMap = mLegend->composerMap();
if ( linkedMap && linkedMap->keepLayerSet() )
{
QgsMapRenderer* renderer = canvas->mapRenderer();
if ( renderer )
//if there is a linked map, and if that linked map has a locked layer set, we take the layerIdList from that ComposerMap
layerIdList = linkedMap->layerSet();
}
else
{
//we take the layerIdList from the Canvas
QgsMapCanvas* canvas = app->mapCanvas();
if ( canvas )
{
layerIdList = renderer->layerSet();
QgsMapRenderer* renderer = canvas->mapRenderer();
if ( renderer )
{
layerIdList = renderer->layerSet();
}
}
}


//and also group info
QgsAppLegendInterface legendIface( app->legend() );
QList< GroupLayerInfo > groupInfo = legendIface.groupLayerRelationship();

0 comments on commit 177e5a1

Please sign in to comment.