Skip to content

Commit

Permalink
Fix tests: clear layers before theme export
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and github-actions[bot] committed Jun 9, 2021
1 parent 5410095 commit d10331e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/core/layout/qgslayoutitemmap.cpp
Expand Up @@ -347,10 +347,7 @@ void QgsLayoutItemMap::setFollowVisibilityPreset( bool follow )
return;

mFollowVisibilityPreset = follow;
if ( follow )
{
mLayers.clear();
}

if ( !mFollowVisibilityPresetName.isEmpty() )
emit themeChanged( mFollowVisibilityPreset ? mFollowVisibilityPresetName : QString() );
}
Expand Down
4 changes: 4 additions & 0 deletions tests/src/core/testqgslayoutgeopdfexport.cpp
Expand Up @@ -256,6 +256,10 @@ void TestQgsLayoutGeoPdfExport::testCollectingFeatures()
map2->setFollowVisibilityPreset( true );
map2->setFollowVisibilityPresetName( QStringLiteral( "test preset3" ) );

// Clear layers
map->setLayers( {} );
map2->setLayers( {} );

QgsLayoutGeoPdfExporter geoPdfExporter2( &l );
settings = QgsLayoutExporter::PdfExportSettings();
settings.writeGeoPdf = true;
Expand Down

0 comments on commit d10331e

Please sign in to comment.