Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reverse order
  • Loading branch information
domi4484 committed May 23, 2023
1 parent 804eb61 commit b2b0e38
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core/vector/qgsvectorlayereditbuffergroup.cpp
Expand Up @@ -399,20 +399,20 @@ QList<QgsVectorLayer *> QgsVectorLayerEditBufferGroup::orderLayersParentsToChild
QSet<QgsVectorLayer *>::iterator unorderedLayerIterator = unorderedLayers.begin();
while ( unorderedLayerIterator != unorderedLayers.end() )
{
// Get referencing layers
const QList<QgsRelation> referencedRelations = QgsProject::instance()->relationManager()->referencedRelations( *unorderedLayerIterator );
// Get referencing relation to find referenced layers
const QList<QgsRelation> referencingRelations = QgsProject::instance()->relationManager()->referencingRelations( *unorderedLayerIterator );

// If at least one modified layer references this layer continue
bool layerReferenced = false;
for ( const QgsRelation &relation : referencedRelations )
// If this layer references at least one modified layer continue
bool layerReferencingModifiedLayer = false;
for ( const QgsRelation &relation : referencingRelations )
{
if ( unorderedLayers.contains( relation.referencingLayer() ) )
if ( unorderedLayers.contains( relation.referencedLayer() ) )
{
layerReferenced = true;
layerReferencingModifiedLayer = true;
break;
}
}
if ( layerReferenced )
if ( layerReferencingModifiedLayer )
{
++unorderedLayerIterator;
continue;
Expand Down

0 comments on commit b2b0e38

Please sign in to comment.