Skip to content

Commit 1f5d4ba

Browse files
author
wonder
committedNov 12, 2010
Fix a crash in Symbol properties dialog when removed a layer. (#2995)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14553 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,16 @@ void QgsSymbolV2PropertiesDialog::removeLayer()
355355
{
356356
int idx = currentLayerIndex();
357357
if ( idx < 0 ) return;
358+
int row = currentRowIndex();
358359
mSymbol->deleteSymbolLayer( idx );
359360

360361
loadSymbol();
361362

362363
updateUi();
364+
365+
// set previous layer as active
366+
QModelIndex newIndex = listLayers->model()->index( qMin(row, mSymbol->symbolLayerCount()-1), 0 );
367+
listLayers->setCurrentIndex( newIndex );
363368
}
364369

365370

0 commit comments

Comments
 (0)
Please sign in to comment.