Skip to content
Permalink
Browse files

Fix issue with combination of edit buffer + vector join

  • Loading branch information
wonder-sk committed Jan 13, 2014
1 parent 7397bd8 commit 6d3f1b8a16f2f71fefc91507568a9b753ce53b4e
Showing with 9 additions and 6 deletions.
  1. +9 −6 src/core/qgsvectorlayerfeatureiterator.cpp
@@ -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() )
@@ -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;
@@ -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() )

0 comments on commit 6d3f1b8

Please sign in to comment.
You can’t perform that action at this time.