Skip to content

Commit

Permalink
Fix a crash in Symbol properties dialog when removed a layer. (#2995)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14553 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 12, 2010
1 parent 3948b46 commit 1f5d4ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,16 @@ void QgsSymbolV2PropertiesDialog::removeLayer()
{
int idx = currentLayerIndex();
if ( idx < 0 ) return;
int row = currentRowIndex();
mSymbol->deleteSymbolLayer( idx );

loadSymbol();

updateUi();

// set previous layer as active
QModelIndex newIndex = listLayers->model()->index( qMin(row, mSymbol->symbolLayerCount()-1), 0 );
listLayers->setCurrentIndex( newIndex );
}


Expand Down

0 comments on commit 1f5d4ba

Please sign in to comment.