Skip to content
Permalink
Browse files

vector layer: changing of attributes and geometry of new features doe…

…sn't require ChangeGeometry/ChangeAttributeValues capabilities (fixes #12909)
  • Loading branch information
jef-n committed Jun 8, 2015
1 parent 402df03 commit 77bf10b752a264342653b4a953cf389ed5c28714
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/core/qgsvectorlayereditbuffer.cpp
@@ -164,9 +164,6 @@ bool QgsVectorLayerEditBuffer::deleteFeature( QgsFeatureId fid )

bool QgsVectorLayerEditBuffer::changeGeometry( QgsFeatureId fid, QgsGeometry* geom )
{
if ( !( L->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries ) )
return false;

if ( !L->hasGeometryType() )
{
return false;
@@ -177,6 +174,8 @@ bool QgsVectorLayerEditBuffer::changeGeometry( QgsFeatureId fid, QgsGeometry* ge
if ( !mAddedFeatures.contains( fid ) )
return false;
}
else if ( !( L->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries ) )
return false;

// TODO: check compatible geometry

@@ -187,14 +186,15 @@ bool QgsVectorLayerEditBuffer::changeGeometry( QgsFeatureId fid, QgsGeometry* ge

bool QgsVectorLayerEditBuffer::changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue )
{
if ( !( L->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues ) )
return false;

if ( FID_IS_NEW( fid ) )
{
if ( !mAddedFeatures.contains( fid ) )
return false;
}
else if ( !( L->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues ) )
{
return false;
}

if ( field < 0 || field >= L->pendingFields().count() ||
L->pendingFields().fieldOrigin( field ) == QgsFields::OriginJoin ||

0 comments on commit 77bf10b

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