Skip to content

Commit 78cb79b

Browse files
committed
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)
1 parent d607a56 commit 78cb79b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
210210
void updateColorRamp( QgsVectorColorRampV2* ramp /Transfer/ = 0, bool inverted = false );
211211

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

215215
void setRotationField( QString fieldOrExpression );
216216
QString rotationField() const;

src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ void QgsCategorizedSymbolRendererV2::updateSymbols( QgsSymbolV2 * sym )
763763
updateCategorySymbol( i, symbol );
764764
++i;
765765
}
766+
setSourceSymbol( sym->clone() );
766767
}
767768

768769
void QgsCategorizedSymbolRendererV2::setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod )

src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ void QgsCategorizedSymbolRendererV2Widget::changeCategorizedSymbol()
536536
QgsSymbolV2* newSymbol = mCategorizedSymbol->clone();
537537

538538
QgsSymbolV2SelectorDialog dlg( newSymbol, mStyle, mLayer, this );
539-
if ( !dlg.exec() )
539+
if ( !dlg.exec() || !newSymbol )
540540
{
541541
delete newSymbol;
542542
return;

0 commit comments

Comments
 (0)