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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Oct 22 15:45:21 EDT 2010


Author: wonder
Date: 2010-10-22 12:45:21 -0700 (Fri, 22 Oct 2010)
New Revision: 14427

Modified:
   trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
Log:
Fix a crash (#3147)


Modified: trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp	2010-10-22 03:00:11 UTC (rev 14426)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp	2010-10-22 19:45:21 UTC (rev 14427)
@@ -169,9 +169,10 @@
 void QgsSymbolV2PropertiesDialog::updateUi()
 {
   int row = currentRowIndex();
+  int count = listLayers->model()->rowCount();
   btnUp->setEnabled( row > 0 );
-  btnDown->setEnabled( row < listLayers->model()->rowCount() - 1 && row != -1 );
-  btnRemoveLayer->setEnabled( row != -1 );
+  btnDown->setEnabled( row < count - 1 && row != -1 );
+  btnRemoveLayer->setEnabled( count > 1 && row != -1 );
 }
 
 void QgsSymbolV2PropertiesDialog::updatePreview()



More information about the QGIS-commit mailing list