Skip to content
Permalink
Browse files

Fix categorised renderer does not store changes to the source symbol

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 78cb79bca1a23c8fffb0d2d73943bdcd2cb6094a
@@ -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;
@@ -763,6 +763,7 @@ void QgsCategorizedSymbolRendererV2::updateSymbols( QgsSymbolV2 * sym )
updateCategorySymbol( i, symbol );
++i;
}
setSourceSymbol( sym->clone() );
}

void QgsCategorizedSymbolRendererV2::setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod )
@@ -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;

0 comments on commit 78cb79b

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