[QGIS Commit] r10875 - trunk/qgis/src/app/attributetable

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jun 2 10:40:04 EDT 2009


Author: jef
Date: 2009-06-02 10:40:04 -0400 (Tue, 02 Jun 2009)
New Revision: 10875

Modified:
   trunk/qgis/src/app/attributetable/qgsattributetablememorymodel.cpp
   trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
Log:
fix attribute table edit problem when geometry is not last column in postgis tables

Modified: trunk/qgis/src/app/attributetable/qgsattributetablememorymodel.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetablememorymodel.cpp	2009-06-01 21:21:51 UTC (rev 10874)
+++ trunk/qgis/src/app/attributetable/qgsattributetablememorymodel.cpp	2009-06-02 14:40:04 UTC (rev 10875)
@@ -118,9 +118,9 @@
 
 
 // QgsDebugMsg(mFeatureMap[rowToId(index.row())].id());
-    mFeatureMap[rowToId( index.row() )].changeAttribute( index.column(), value );
+    mFeatureMap[rowToId( index.row() )].changeAttribute( mAttributes[ index.column()], value );
     // propagate back to the layer
-    mLayer->changeAttributeValue( rowToId( index.row() ), index.column(), value, true );
+    mLayer->changeAttributeValue( rowToId( index.row() ), mAttributes[ index.column()], value, true );
   }
 
   if ( !mLayer->isModified() )

Modified: trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp	2009-06-01 21:21:51 UTC (rev 10874)
+++ trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp	2009-06-02 14:40:04 UTC (rev 10875)
@@ -394,7 +394,7 @@
     mLastRowId = rowToId( index.row() );
     mLastRow = ( QgsAttributeMap * )( &( mFeat.attributeMap() ) );
 
-    mLayer->changeAttributeValue( rowToId( index.row() ), index.column(), value, true );
+    mLayer->changeAttributeValue( rowToId( index.row() ), mAttributes[ index.column()], value, true );
   }
 
   if ( !mLayer->isModified() )



More information about the QGIS-commit mailing list