File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -395,14 +395,8 @@ namespace QgsWms
395
395
throw QgsBadRequestException ( QStringLiteral ( " AtlasPrintError" ),
396
396
QStringLiteral ( " The atlas has no coverage layer" ) );
397
397
}
398
- QgsVectorDataProvider *cProvider = cLayer->dataProvider ();
399
- if ( !cProvider )
400
- {
401
- throw QgsBadRequestException ( QStringLiteral ( " AtlasPrintError" ),
402
- QStringLiteral ( " An error occured during the Atlas print" ) );
403
- }
404
398
405
- QgsAttributeList pkIndexes = cProvider-> pkAttributeIndexes ();
399
+ QgsAttributeList pkIndexes = cLayer-> primaryKeyAttributes ();
406
400
if ( pkIndexes.size () < 1 )
407
401
{
408
402
throw QgsBadRequestException ( QStringLiteral ( " AtlasPrintError" ),
@@ -411,7 +405,7 @@ namespace QgsWms
411
405
QStringList pkAttributeNames;
412
406
for ( int i = 0 ; i < pkIndexes.size (); ++i )
413
407
{
414
- pkAttributeNames.append ( cProvider ->fields ()[pkIndexes.at ( i )].name () );
408
+ pkAttributeNames.append ( cLayer ->fields ()[pkIndexes.at ( i )].name () );
415
409
}
416
410
417
411
int nAtlasFeatures = atlasPk.size () / pkIndexes.size ();
You can’t perform that action at this time.
0 commit comments