Skip to content

Commit

Permalink
Actually apply default value
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent 05adea8 commit 4c118be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
}
Expand Down

0 comments on commit 4c118be

Please sign in to comment.