Skip to content

Commit 23dd29f

Browse files
committed
Fix for ticket #4283 (composer forgets on/off status of layers)
1 parent 810ee5e commit 23dd29f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/core/composer/qgscomposermap.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,17 @@ void QgsComposerMap::syncLayerSet()
822822
return;
823823
}
824824

825-
QStringList currentLayerSet = mMapRenderer->layerSet();
825+
//if layer set is fixed, do a lookup in the layer registry to also find the non-visible layers
826+
QStringList currentLayerSet;
827+
if ( mKeepLayerSet )
828+
{
829+
currentLayerSet = QgsMapLayerRegistry::instance()->mapLayers().uniqueKeys();
830+
}
831+
else //only consider layers visible in the map
832+
{
833+
currentLayerSet = mMapRenderer->layerSet();
834+
}
835+
826836
for ( int i = mLayerSet.size() - 1; i >= 0; --i )
827837
{
828838
if ( !currentLayerSet.contains( mLayerSet.at( i ) ) )

0 commit comments

Comments
 (0)