Skip to content
Permalink
Browse files

Applied patch provided by Adrien to fix problem where attributes wher…

…e not copied for modified features

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8634 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jun 9, 2008
1 parent bab4785 commit 6b5d9d6523c6d9b41eb19e71fe1c82c251c90da3
Showing with 24 additions and 4 deletions.
  1. +24 −4 src/core/qgsvectorlayer.cpp
@@ -1273,10 +1273,30 @@ int QgsVectorLayer::featuresInRectangle(const QgsRect& searchRect, QList<QgsFeat
}
if(fetchAttributes)
{
QgsFeature tmpFeature;
mDataProvider->getFeatureAtId(changedIt.key(), tmpFeature, false, mDataProvider->allAttributesList());
newFeature.setAttributeMap(tmpFeature.attributeMap());

if(changedIt.key()<0)
{
//The feature is in mAddedFeature's list because its id<0
bool findMyFeature = false;
for (QgsFeatureList::iterator iter = mAddedFeatures.begin(); iter != mAddedFeatures.end(); ++iter)
{
if(iter->featureId()==changedIt.key())
{
findMyFeature = true;
newFeature.setAttributeMap(iter->attributeMap());
break;
}
}
if(!findMyFeature)
{
QgsLogger::warning("No attribute for the feature");
}
}
else
{
QgsFeature tmpFeature;
mDataProvider->getFeatureAtId(changedIt.key(), tmpFeature, false, mDataProvider->allAttributesList());
newFeature.setAttributeMap(tmpFeature.attributeMap());
}
}
features.push_back(newFeature);
}

0 comments on commit 6b5d9d6

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