Skip to content

Commit

Permalink
fix attribute table edit problem when geometry is not last column in …
Browse files Browse the repository at this point in the history
…postgis tables

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10875 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 2, 2009
1 parent 780b5fa commit fad8260
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/attributetable/qgsattributetablememorymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ bool QgsAttributeTableMemoryModel::setData( const QModelIndex &index, const QVar


// 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() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/attributetable/qgsattributetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &
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() )
Expand Down

0 comments on commit fad8260

Please sign in to comment.