Skip to content

Commit

Permalink
Fix issue with combination of edit buffer + vector join
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 13, 2014
1 parent 7397bd8 commit 6d3f1b8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/core/qgsvectorlayerfeatureiterator.cpp
Expand Up @@ -55,12 +55,6 @@ QgsFeatureIterator QgsVectorLayerFeatureSource::getFeatures( const QgsFeatureReq
QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(QgsVectorLayerFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
: QgsAbstractFeatureIteratorFromSource( source, ownSource, request )
{
mChangedFeaturesRequest = mRequest;

if ( mSource->mHasEditBuffer )
{
mChangedFeaturesRequest.setFilterFids( mSource->mChangedAttributeValues.keys().toSet() );
}

// prepare joins: may add more attributes to fetch (in order to allow join)
if ( mSource->mJoinBuffer->containsJoins() )
Expand All @@ -85,6 +79,12 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(QgsVectorLayerFeatu
mProviderRequest.setSubsetOfAttributes( providerSubset );
}

if ( mSource->mHasEditBuffer )
{
mChangedFeaturesRequest = mProviderRequest;
mChangedFeaturesRequest.setFilterFids( mSource->mChangedAttributeValues.keys().toSet() );
}

if ( request.filterType() == QgsFeatureRequest::FilterFid )
{
mFetchedFid = false;
Expand Down Expand Up @@ -302,6 +302,9 @@ bool QgsVectorLayerFeatureIterator::fetchNextChangedAttributeFeature( QgsFeature

updateChangedAttributes( f );

if ( !mFetchJoinInfo.isEmpty() )
addJoinedAttributes( f );

if ( mRequest.filterType() == QgsFeatureRequest::FilterExpression )
{
if ( mRequest.filterExpression()->evaluate( &f ).toBool() )
Expand Down

0 comments on commit 6d3f1b8

Please sign in to comment.