Fix a crash in Symbol properties dialog when removed a layer. (#2995)

git-svn-id: http://svn.osgeo.org/qgis/trunk@14553 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2010-11-12 11:25:37 +00:00
parent be0aef5d2e
commit 06305bc433

View File

@ -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 );
}