Skip to content
Permalink
Browse files

Fix for using ellipses with renderers other than single

  • Loading branch information
mhugent committed Jun 20, 2011
1 parent 2f3fb28 commit ce826f6eb2563bf24bfb30ced4d97fa6761df608
@@ -280,13 +280,27 @@ void QgsCategorizedSymbolRendererV2::stopRender( QgsRenderContext& context )

QList<QString> QgsCategorizedSymbolRendererV2::usedAttributes()
{
QList<QString> lst;
lst.append( mAttrName );
QSet<QString> attributes;
attributes.insert( mAttrName );
if ( !mRotationField.isEmpty() )
lst.append( mRotationField );
{
attributes.insert( mRotationField );
}
if ( !mSizeScaleField.isEmpty() )
lst.append( mSizeScaleField );
return lst;
{
attributes.insert( mSizeScaleField );
}

QgsCategoryList::const_iterator catIt = mCategories.constBegin();
for ( ; catIt != mCategories.constEnd(); ++catIt )
{
QgsSymbolV2* catSymbol = catIt->symbol();
if ( catSymbol )
{
attributes.unite( catSymbol->usedAttributes() );
}
}
return attributes.toList();
}

QString QgsCategorizedSymbolRendererV2::dump()
@@ -218,29 +218,28 @@ void QgsGraduatedSymbolRendererV2::stopRender( QgsRenderContext& context )

QList<QString> QgsGraduatedSymbolRendererV2::usedAttributes()
{
QSet<QString> attributes;

QgsSymbolV2* symbol = 0;
QgsRangeList::const_iterator range_it = mRanges.constBegin();
for(; range_it != mRanges.constEnd(); ++range_it )
{
symbol = range_it->symbol();
if ( symbol )
{
attributes.unite( symbol->usedAttributes() );
}
}
QSet<QString> attributes;
attributes.insert( mAttrName );
if ( !mRotationField.isEmpty() )
{
attributes.insert( mRotationField );
}
if ( !mSizeScaleField.isEmpty() )
{
attributes.insert( mSizeScaleField );
}

if ( !mRotationField.isEmpty() )
{
attributes.insert( mRotationField );
}
if ( !mSizeScaleField.isEmpty() )
QgsSymbolV2* symbol = 0;
QgsRangeList::const_iterator range_it = mRanges.constBegin();
for ( ; range_it != mRanges.constEnd(); ++range_it )
{
symbol = range_it->symbol();
if ( symbol )
{
attributes.insert( mSizeScaleField );
attributes.unite( symbol->usedAttributes() );
}

return attributes.toList();
}
return attributes.toList();
}

bool QgsGraduatedSymbolRendererV2::updateRangeSymbol( int rangeIndex, QgsSymbolV2* symbol )
@@ -191,6 +191,10 @@ QList<QString> QgsRuleBasedRendererV2::usedAttributes()
{
Rule& rule = *it;
attrs.unite( rule.needsFields().toSet() );
if ( rule.symbol() )
{
attrs.unite( rule.symbol()->usedAttributes() );
}
}
return attrs.values();
}

0 comments on commit ce826f6

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