Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 29, 2015
1 parent 129be68 commit a4cfdcb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/qgsvectorlayereditbuffer.cpp
Expand Up @@ -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;
Expand All @@ -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

Expand All @@ -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 ||
Expand Down

0 comments on commit a4cfdcb

Please sign in to comment.