Skip to content

Commit

Permalink
don't use last used values on primary key fields (fixes #14154)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 21, 2016
1 parent 4d2c108 commit fdeff63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/qgsfeatureaction.cpp
Expand Up @@ -135,6 +135,7 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
return false; return false;


QgsVectorDataProvider *provider = mLayer->dataProvider(); QgsVectorDataProvider *provider = mLayer->dataProvider();
QgsAttributeList pkAttrList = mLayer->pkAttributeList();


QSettings settings; QSettings settings;
bool reuseLastValues = settings.value( "/qgis/digitizing/reuseLastValues", false ).toBool(); bool reuseLastValues = settings.value( "/qgis/digitizing/reuseLastValues", false ).toBool();
Expand All @@ -151,7 +152,7 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
{ {
v = defaultAttributes.value( idx ); v = defaultAttributes.value( idx );
} }
else if ( reuseLastValues && sLastUsedValues.contains( mLayer ) && sLastUsedValues[ mLayer ].contains( idx ) ) else if ( reuseLastValues && sLastUsedValues.contains( mLayer ) && sLastUsedValues[ mLayer ].contains( idx ) && !pkAttrList.contains( idx ) )
{ {
v = sLastUsedValues[ mLayer ][idx]; v = sLastUsedValues[ mLayer ][idx];
} }
Expand Down

0 comments on commit fdeff63

Please sign in to comment.