Skip to content

Commit

Permalink
Fix for ticket #4283 (composer forgets on/off status of layers)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Sep 19, 2011
1 parent 8905274 commit 820469f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/core/composer/qgscomposermap.cpp
Expand Up @@ -839,7 +839,17 @@ void QgsComposerMap::syncLayerSet()
return;
}

QStringList currentLayerSet = mMapRenderer->layerSet();
//if layer set is fixed, do a lookup in the layer registry to also find the non-visible layers
QStringList currentLayerSet;
if ( mKeepLayerSet )
{
currentLayerSet = QgsMapLayerRegistry::instance()->mapLayers().uniqueKeys();
}
else //only consider layers visible in the map
{
currentLayerSet = mMapRenderer->layerSet();
}

for ( int i = mLayerSet.size() - 1; i >= 0; --i )
{
if ( !currentLayerSet.contains( mLayerSet.at( i ) ) )
Expand Down

0 comments on commit 820469f

Please sign in to comment.