Skip to content
Permalink
Browse files

Use QgsLayerStyleOverride in QgsMapHitTest::runHitTestLayer

  • Loading branch information
nirvn committed Jun 11, 2018
1 parent 5c267f2 commit d62c34af0e27edc41495028906d8ec1bad840704
Showing with 3 additions and 6 deletions.
  1. +3 −6 src/core/qgsmaphittest.cpp
@@ -101,9 +101,9 @@ bool QgsMapHitTest::legendKeyVisible( const QString &ruleKey, QgsVectorLayer *la

void QgsMapHitTest::runHitTestLayer( QgsVectorLayer *vl, SymbolSet &usedSymbols, SymbolSet &usedSymbolsRuleKey, QgsRenderContext &context )
{
bool hasStyleOverride = mSettings.layerStyleOverrides().contains( vl->id() );
if ( hasStyleOverride )
vl->styleManager()->setOverrideStyle( mSettings.layerStyleOverrides().value( vl->id() ) );
QgsLayerStyleOverride styleOverride( vl );
if ( mSettings.layerStyleOverrides().contains( vl->id() ) )
styleOverride.setOverrideStyle( mSettings.layerStyleOverrides().value( vl->id() ) );

std::unique_ptr< QgsFeatureRenderer > r( vl->renderer()->clone() );
bool moreSymbolsPerFeature = r->capabilities() & QgsFeatureRenderer::MoreSymbolsPerFeature;
@@ -199,8 +199,5 @@ void QgsMapHitTest::runHitTestLayer( QgsVectorLayer *vl, SymbolSet &usedSymbols,
usedSymbols = lUsedSymbols;
usedSymbolsRuleKey = lUsedSymbolsRuleKey;
}

if ( hasStyleOverride )
vl->styleManager()->restoreOverrideStyle();
}

0 comments on commit d62c34a

Please sign in to comment.
You can’t perform that action at this time.