File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -132,24 +132,34 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
132132 if ( !layers.isEmpty () )
133133 {
134134 QStringList layerSet;
135- QStringList wmsLayerList = layers.split ( " ," );
135+ QStringList wmsLayerList = layers.split ( " ," , QString::SkipEmptyParts );
136136 QStringList wmsStyleList;
137137
138138 if ( !styles.isEmpty () )
139139 {
140- wmsStyleList = styles.split ( " ," );
140+ wmsStyleList = styles.split ( " ," , QString::SkipEmptyParts );
141141 }
142142
143143 for ( int i = 0 ; i < wmsLayerList.size (); ++i )
144144 {
145+ QString wmsLayer = wmsLayerList.at ( i );
145146 QString styleName;
146147 if ( wmsStyleList.size () > i )
147148 {
148149 styleName = wmsStyleList.at ( i );
149150 }
151+
152+ bool allowCaching = true ;
153+ if ( wmsLayerList.count ( wmsLayer ) > 1 )
154+ {
155+ allowCaching = false ;
156+ }
150157
151- Q_FOREACH ( QgsMapLayer *layer, mapLayerFromStyle ( wmsLayerList.at ( i ), styleName ) )
158+ QList<QgsMapLayer*> layerList = mapLayerFromStyle ( wmsLayer, styleName, allowCaching );
159+ int listIndex;
160+ for ( listIndex = layerList.size () - 1 ; listIndex >= 0 ; listIndex-- )
152161 {
162+ QgsMapLayer* layer = layerList.at ( listIndex );
153163 if ( layer )
154164 {
155165 layerSet.push_back ( layer->id () );
You can’t perform that action at this time.
0 commit comments