Skip to content

Commit

Permalink
Fix for using ellipses with renderers other than single
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 20, 2011
1 parent 2f3fb28 commit ce826f6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 25 deletions.
24 changes: 19 additions & 5 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -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()
Expand Down
39 changes: 19 additions & 20 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -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 )
Expand Down
4 changes: 4 additions & 0 deletions src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit ce826f6

Please sign in to comment.