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)

(cherry-picked from 77bf10b)
  • Loading branch information
jef-n committed Jun 8, 2015
1 parent 129be68 commit a4cfdcbbe7ed6e47d696279c0e1f9e38a6f00a33
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/core/qgsvectorlayereditbuffer.cpp
@@ -162,9 +162,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;
@@ -175,6 +172,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

@@ -185,14 +184,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 a4cfdcb

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