[QGIS Commit] r10263 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Mar 5 10:03:31 EST 2009


Author: jef
Date: 2009-03-05 10:03:31 -0500 (Thu, 05 Mar 2009)
New Revision: 10263

Modified:
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
Log:
fix #1564

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2009-03-04 13:26:38 UTC (rev 10262)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2009-03-05 15:03:31 UTC (rev 10263)
@@ -512,15 +512,16 @@
     QgsVectorLayer::EditType editType = ( QgsVectorLayer::EditType ) cb->itemData( cb->currentIndex() ).toInt();
     layer->setEditType( idx, editType );
 
+    QString value = tblAttributes->item( i, 7 ) ? tblAttributes->item( i, 7 )->text() : QString::null;
+
     if ( editType == QgsVectorLayer::ValueMap )
     {
       QMap<QString, QVariant> &map = layer->valueMap( idx );
       map.clear();
 
-      QString value = tblAttributes->item( i, 7 )->text();
       if ( !value.isEmpty() )
       {
-        QStringList values = tblAttributes->item( i, 7 )->text().split( ";" );
+        QStringList values = value.split( ";" );
         for ( int j = 0; j < values.size(); j++ )
         {
           QStringList args = values[j].split( "=" );
@@ -548,7 +549,7 @@
     else if ( editType == QgsVectorLayer::EditRange ||
               editType == QgsVectorLayer::SliderRange )
     {
-      QStringList values = tblAttributes->item( i, 7 )->text().split( ";" );
+      QStringList values = value.split( ";" );
 
       if ( values.size() == 3 )
       {



More information about the QGIS-commit mailing list