Skip to content

Commit 0ca359e

Browse files
committed
make QLR files containing non-vector layers work again
This was a regression introduced in ff3200f. (fixes #14091)
1 parent 4451f29 commit 0ca359e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/qgslayerdefinition.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ bool QgsLayerDefinition::loadLayerDefinition( QDomDocument doc, QgsLayerTreeGrou
131131
// Now that all layers are loaded, refresh the vectorjoins to get the joined fields
132132
Q_FOREACH ( QgsMapLayer* layer, layers )
133133
{
134-
QgsVectorLayer* vlayer = static_cast< QgsVectorLayer * >( layer );
134+
QgsVectorLayer* vlayer = dynamic_cast< QgsVectorLayer * >( layer );
135135
if ( vlayer )
136136
{
137137
vlayer->createJoinCaches();

tests/src/core/testqgsvectorlayerjoinbuffer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ void TestVectorLayerJoinBuffer::testJoinLayerDefinitionFile()
384384
QList<QgsMapLayer*> mapLayers = QgsMapLayerRegistry::instance()->mapLayersByName( "layerB" );
385385
QCOMPARE( mapLayers.count(), 1 );
386386

387-
QgsVectorLayer* vLayer = static_cast<QgsVectorLayer*>( mapLayers.value( 0 ) );
387+
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer*>( mapLayers.value( 0 ) );
388388
QVERIFY( vLayer );
389389

390390
// Check for vector join

0 commit comments

Comments
 (0)