Skip to content
Permalink
Browse files

use previous renderer if possible, instead of last applied renderer

  • Loading branch information
leyan committed Aug 24, 2014
1 parent 45dfd53 commit 4c51956b896264366b8e422542e25bac8e5c8ba1
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
@@ -144,6 +144,17 @@ void QgsRendererV2PropertiesDialog::rendererChanged()

QString rendererName = cboRenderers->itemData( cboRenderers->currentIndex() ).toString();

//Retrieve the previous renderer: from the old active widget if possible, otherwise from the layer
QgsFeatureRendererV2* oldRenderer;
if ( mActiveWidget )
{
oldRenderer = mActiveWidget->renderer()->clone();
}
else
{
oldRenderer = mLayer->rendererV2()->clone();
}

// get rid of old active widget (if any)
if ( mActiveWidget )
{
@@ -156,7 +167,7 @@ void QgsRendererV2PropertiesDialog::rendererChanged()
QgsRendererV2Widget* w = NULL;
QgsRendererV2AbstractMetadata* m = QgsRendererV2Registry::instance()->rendererMetadata( rendererName );
if ( m != NULL )
w = m->createRendererWidget( mLayer, mStyle, mLayer->rendererV2()->clone() );
w = m->createRendererWidget( mLayer, mStyle, oldRenderer );

if ( w != NULL )
{

0 comments on commit 4c51956

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