File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -201,15 +201,21 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
201
201
continue ;
202
202
}
203
203
204
+ // The layer set has entries if the composer map has a locked layer set or
205
+ // if the composer map layer set has been constrained in the WMS request.
206
+ // If this is not the case, there is no need to modify the layers in the legend here
207
+ QStringList layerSet = map->layerSet ();
208
+ if ( layerSet.size () < 1 )
209
+ {
210
+ continue ;
211
+ }
212
+
204
213
// get model and layer tree root of the legend
205
214
QgsLegendModelV2* model = currentLegend->modelV2 ();
206
215
QgsLayerTreeGroup* root = model->rootGroup ();
207
216
208
-
209
217
// get layerIds find in the layer tree root
210
218
QStringList layerIds = root->findLayerIds ();
211
- // get map layerIds
212
- QStringList layerSet = map->layerSet ();
213
219
214
220
// get map scale
215
221
double scale = map->scale ();
You can’t perform that action at this time.
0 commit comments