Skip to content

Commit

Permalink
Fix feature request with Fid Filter working on the edit buffer
Browse files Browse the repository at this point in the history
The following snippet did not take attribut changes that have not been commited
into account.

    layer.getFeatures( QgsFeatureRequest( fid ) ).next()

Fixes the VectorLayer test
  • Loading branch information
m-kuhn committed Nov 5, 2014
1 parent 98c9ec7 commit 64b634f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayerfeatureiterator.cpp
Expand Up @@ -410,7 +410,7 @@ void QgsVectorLayerFeatureIterator::useChangedAttributeFeature( QgsFeatureId fid
QgsFeatureIterator fi = mSource->mProviderFeatureSource->getFeatures( request );
if ( fi.nextFeature( tmp ) )
{
if ( mHasVirtualAttributes )
if ( mHasVirtualAttributes || mSource->mHasEditBuffer )
updateChangedAttributes( tmp );
f.setAttributes( tmp.attributes() );
}
Expand Down Expand Up @@ -506,7 +506,7 @@ void QgsVectorLayerFeatureIterator::prepareExpressions()
if ( mRequest.flags() & QgsFeatureRequest::SubsetOfAttributes )
{
QgsAttributeList attrs;
Q_FOREACH ( const QString& col, exp->referencedColumns() )
Q_FOREACH( const QString& col, exp->referencedColumns() )
{
attrs.append( mSource->mFields.fieldNameIndex( col ) );
}
Expand Down

0 comments on commit 64b634f

Please sign in to comment.