Skip to content
Permalink
Browse files

don't use last used values on primary key fields (fixes #14154)

  • Loading branch information
jef-n committed Jan 21, 2016
1 parent 4d2c108 commit fdeff6354227f7e2f102706866102096ad6b5599
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/qgsfeatureaction.cpp
@@ -135,6 +135,7 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
return false;

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

QSettings settings;
bool reuseLastValues = settings.value( "/qgis/digitizing/reuseLastValues", false ).toBool();
@@ -151,7 +152,7 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
{
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];
}

0 comments on commit fdeff63

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