Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
categorized renderer: show category by default (followup 4867b7f)
  • Loading branch information
jef-n committed Jul 4, 2014
1 parent b4edd9d commit 51408e1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Expand Up @@ -6,7 +6,7 @@ class QgsRendererCategoryV2
public:

//! takes ownership of symbol
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol /Transfer/, QString label, bool render );
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol /Transfer/, QString label, bool render = true );

//! copy constructor
QgsRendererCategoryV2( const QgsRendererCategoryV2& cat );
Expand Down
5 changes: 4 additions & 1 deletion src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -752,7 +752,10 @@ bool QgsCategorizedSymbolRendererV2::legendSymbolItemsCheckable() const

bool QgsCategorizedSymbolRendererV2::legendSymbolItemChecked( int index )
{
return index < 0 ? true : mCategories[ index ].renderState();
if( index >= 0 && index < mCategories.size() )
return mCategories[ index ].renderState();
else
return true;
}

void QgsCategorizedSymbolRendererV2::checkLegendSymbolItem( int index, bool state )
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgscategorizedsymbolrendererv2.h
Expand Up @@ -32,7 +32,7 @@ class CORE_EXPORT QgsRendererCategoryV2
QgsRendererCategoryV2( );

//! takes ownership of symbol
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol, QString label, bool render );
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol, QString label, bool render = true );

//! copy constructor
QgsRendererCategoryV2( const QgsRendererCategoryV2& cat );
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsrendererv2.h
Expand Up @@ -156,7 +156,7 @@ class CORE_EXPORT QgsFeatureRendererV2

//! items of symbology items in legend is checked
//! @note added in 2.5
virtual bool legendSymbolItemChecked( int key );
virtual bool legendSymbolItemChecked( int index );

//! item in symbology was checked
//! @note added in 2.5
Expand Down

0 comments on commit 51408e1

Please sign in to comment.