Skip to content

Commit

Permalink
Fix categorised renderer does not store changes to the source symbol
Browse files Browse the repository at this point in the history
Avoids the frustrating situation where changes to a symbol in the
categorised renderer are lost when the layer properties window
is reopened

Also fix a leak in the Python bindings

(cherry-picked from 3744ac2)
  • Loading branch information
nyalldawson committed Feb 23, 2016
1 parent d607a56 commit 78cb79b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
Expand Up @@ -210,7 +210,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
void updateColorRamp( QgsVectorColorRampV2* ramp /Transfer/ = 0, bool inverted = false );

/** Update all the symbols but leave breaks and colors. */
void updateSymbols( QgsSymbolV2* sym /Transfer/ );
void updateSymbols( QgsSymbolV2* sym );

void setRotationField( QString fieldOrExpression );
QString rotationField() const;
Expand Down
1 change: 1 addition & 0 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -763,6 +763,7 @@ void QgsCategorizedSymbolRendererV2::updateSymbols( QgsSymbolV2 * sym )
updateCategorySymbol( i, symbol );
++i;
}
setSourceSymbol( sym->clone() );
}

void QgsCategorizedSymbolRendererV2::setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod )
Expand Down
Expand Up @@ -536,7 +536,7 @@ void QgsCategorizedSymbolRendererV2Widget::changeCategorizedSymbol()
QgsSymbolV2* newSymbol = mCategorizedSymbol->clone();

QgsSymbolV2SelectorDialog dlg( newSymbol, mStyle, mLayer, this );
if ( !dlg.exec() )
if ( !dlg.exec() || !newSymbol )
{
delete newSymbol;
return;
Expand Down

0 comments on commit 78cb79b

Please sign in to comment.