Skip to content
Permalink
Browse files

Fix #14001

  • Loading branch information
m-kuhn committed Dec 25, 2015
1 parent d746a94 commit 036eada9903d4e658fe7fcb6c399b61598665d7a
@@ -178,10 +178,19 @@ void QgsCategorizedSymbolRendererV2::rebuildHash()
for ( int i = 0; i < mCategories.size(); ++i )
{
const QgsRendererCategoryV2& cat = mCategories.at( i );
mSymbolHash.insert( cat.value().toString(), ( cat.renderState() || mCounting ) ? cat.symbol() : &sSkipRender );
mSymbolHash.insert( cat.value().toString(), ( cat.renderState() || mCounting ) ? cat.symbol() : skipRender() );
}
}

QgsSymbolV2*QgsCategorizedSymbolRendererV2::skipRender()
{
static QgsMarkerSymbolV2* skipRender = nullptr;
if ( !skipRender )
skipRender = new QgsMarkerSymbolV2();

return skipRender;
}

QgsSymbolV2* QgsCategorizedSymbolRendererV2::symbolForValue( const QVariant& value )
{
// TODO: special case for int, double
@@ -254,7 +263,7 @@ QgsSymbolV2* QgsCategorizedSymbolRendererV2::originalSymbolForFeature( QgsFeatur

// find the right symbol for the category
QgsSymbolV2 *symbol = symbolForValue( value );
if ( symbol == &sSkipRender )
if ( symbol == skipRender() )
return nullptr;

if ( !symbol )
@@ -979,8 +988,6 @@ void QgsCategorizedSymbolRendererV2::checkLegendSymbolItem( const QString& key,
updateCategoryRenderState( index, state );
}

QgsMarkerSymbolV2 QgsCategorizedSymbolRendererV2::sSkipRender;

QgsCategorizedSymbolRendererV2* QgsCategorizedSymbolRendererV2::convertFromRenderer( const QgsFeatureRendererV2 *renderer )
{
if ( renderer->type() == "categorizedSymbol" )
@@ -224,9 +224,9 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2

void rebuildHash();

QgsSymbolV2* symbolForValue( const QVariant& value );
QgsSymbolV2* skipRender();

static QgsMarkerSymbolV2 sSkipRender;
QgsSymbolV2* symbolForValue( const QVariant& value );
};
Q_NOWARN_DEPRECATED_POP

0 comments on commit 036eada

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