diff --git a/src/core/pal/pal.cpp b/src/core/pal/pal.cpp index 83d3b4831238..e4548ca69e61 100644 --- a/src/core/pal/pal.cpp +++ b/src/core/pal/pal.cpp @@ -163,13 +163,13 @@ std::unique_ptr Pal::extractProblem( const QgsRectangle &extent, const candidateProfile = std::make_unique< QgsScopedRuntimeProfile >( QObject::tr( "Generating label candidates" ), QStringLiteral( "rendering" ) ); } - for ( const auto &it : mLayers ) + for ( auto it = mLayers.rbegin(); it != mLayers.rend(); ++it ) { index++; if ( feedback ) feedback->setProgress( index * step ); - Layer *layer = it.second.get(); + Layer *layer = it->second.get(); if ( !layer ) { // invalid layer name @@ -181,12 +181,12 @@ std::unique_ptr Pal::extractProblem( const QgsRectangle &extent, const continue; if ( feedback ) - feedback->emit candidateCreationAboutToBegin( it.first ); + feedback->emit candidateCreationAboutToBegin( it->first ); std::unique_ptr< QgsScopedRuntimeProfile > layerProfile; if ( context.flags() & Qgis::RenderContextFlag::RecordProfile ) { - layerProfile = std::make_unique< QgsScopedRuntimeProfile >( it.first->providerId(), QStringLiteral( "rendering" ) ); + layerProfile = std::make_unique< QgsScopedRuntimeProfile >( it->first->providerId(), QStringLiteral( "rendering" ) ); } // check for connected features with the same label text and join them @@ -338,7 +338,7 @@ std::unique_ptr Pal::extractProblem( const QgsRectangle &extent, const previousObstacleCount = obstacleCount; if ( feedback ) - feedback->emit candidateCreationFinished( it.first ); + feedback->emit candidateCreationFinished( it->first ); } candidateProfile.reset();