Skip to content

Commit e72ad75

Browse files
author
jef
committed
fix attribute table edit problem when geometry is not last column in postgis tables
git-svn-id: http://svn.osgeo.org/qgis/trunk@10875 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f2df647 commit e72ad75

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/app/attributetable/qgsattributetablememorymodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ bool QgsAttributeTableMemoryModel::setData( const QModelIndex &index, const QVar
118118

119119

120120
// QgsDebugMsg(mFeatureMap[rowToId(index.row())].id());
121-
mFeatureMap[rowToId( index.row() )].changeAttribute( index.column(), value );
121+
mFeatureMap[rowToId( index.row() )].changeAttribute( mAttributes[ index.column()], value );
122122
// propagate back to the layer
123-
mLayer->changeAttributeValue( rowToId( index.row() ), index.column(), value, true );
123+
mLayer->changeAttributeValue( rowToId( index.row() ), mAttributes[ index.column()], value, true );
124124
}
125125

126126
if ( !mLayer->isModified() )

src/app/attributetable/qgsattributetablemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &
394394
mLastRowId = rowToId( index.row() );
395395
mLastRow = ( QgsAttributeMap * )( &( mFeat.attributeMap() ) );
396396

397-
mLayer->changeAttributeValue( rowToId( index.row() ), index.column(), value, true );
397+
mLayer->changeAttributeValue( rowToId( index.row() ), mAttributes[ index.column()], value, true );
398398
}
399399

400400
if ( !mLayer->isModified() )

0 commit comments

Comments
 (0)