[QGIS Commit] r14553 - trunk/qgis/src/gui/symbology-ng

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Nov 12 06:25:37 EST 2010


Author: wonder
Date: 2010-11-12 03:25:37 -0800 (Fri, 12 Nov 2010)
New Revision: 14553

Modified:
   trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
Log:
Fix a crash in Symbol properties dialog when removed a layer. (#2995)


Modified: trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp	2010-11-12 10:56:07 UTC (rev 14552)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp	2010-11-12 11:25:37 UTC (rev 14553)
@@ -355,11 +355,16 @@
 {
   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 );
 }
 
 



More information about the QGIS-commit mailing list