Skip to content
Permalink
Browse files

Actually apply default value

  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent 05adea8 commit 4c118be5beca6f7a862f4dce1336b7dd87e9c7e2
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/core/qgsvectorlayer.cpp
@@ -773,14 +773,15 @@ void QgsVectorLayer::updateDefaultValues( QgsFeatureId fid, QgsFeature feature )
if ( !feature.isValid() )
feature = getFeature( fid );

const QgsFields fields = mFields;
int size = fields.size();
int size = mFields.size();
for ( int idx : qgsAsConst( mDefaultValueOnUpdateFields ) )
{
if ( idx < 0 || idx >= size )
continue;

defaultValue( idx, feature );
feature.setAttribute( idx, defaultValue( idx, feature ) );
// TODO catch recursion!!
updateFeature( feature );
}
}
}

0 comments on commit 4c118be

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