[QGIS Commit] r10264 - branches/Version-1_0/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Mar 5 10:06:30 EST 2009


Author: jef
Date: 2009-03-05 10:06:30 -0500 (Thu, 05 Mar 2009)
New Revision: 10264

Modified:
   branches/Version-1_0/src/app/qgsvectorlayerproperties.cpp
Log:
apply r10263 to Version_1.0

Modified: branches/Version-1_0/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- branches/Version-1_0/src/app/qgsvectorlayerproperties.cpp	2009-03-05 15:03:31 UTC (rev 10263)
+++ branches/Version-1_0/src/app/qgsvectorlayerproperties.cpp	2009-03-05 15:06:30 UTC (rev 10264)
@@ -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