Skip to content
Permalink
Browse files
Fix tests: clear layers before theme export
  • Loading branch information
elpaso committed May 26, 2021
1 parent 9fbe839 commit b46ce08ec42ffe660ae958e0dfba9ea7d92dee57
Showing with 5 additions and 4 deletions.
  1. +1 −4 src/core/layout/qgslayoutitemmap.cpp
  2. +4 −0 tests/src/core/testqgslayoutgeopdfexport.cpp
@@ -361,10 +361,7 @@ void QgsLayoutItemMap::setFollowVisibilityPreset( bool follow )
return;

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

if ( !mFollowVisibilityPresetName.isEmpty() )
emit themeChanged( mFollowVisibilityPreset ? mFollowVisibilityPresetName : QString() );
}
@@ -252,6 +252,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;

0 comments on commit b46ce08

Please sign in to comment.