diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.cpp b/src/Mod/Sketcher/App/PropertyConstraintList.cpp index a9663fac9e..eb74972520 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.cpp +++ b/src/Mod/Sketcher/App/PropertyConstraintList.cpp @@ -57,7 +57,10 @@ TYPESYSTEM_SOURCE(Sketcher::PropertyConstraintList, App::PropertyLists) // Construction/Destruction -PropertyConstraintList::PropertyConstraintList() : validGeometryKeys(0), invalidGeometry(true) +PropertyConstraintList::PropertyConstraintList() + : validGeometryKeys(0) + , invalidGeometry(true) + , restoreFromTransaction(false) { } @@ -225,11 +228,11 @@ void PropertyConstraintList::applyValues(std::vector&& lValue) valueMap = std::move(newValueMap); /* Signal removes first, in case renamed values below have the same names as some of the removed ones. */ - if (removed.size() > 0) + if (removed.size() > 0 && !restoreFromTransaction) signalConstraintsRemoved(removed); /* Signal renames */ - if (renamed.size() > 0) + if (renamed.size() > 0 && !restoreFromTransaction) signalConstraintsRenamed(renamed); _lValueList = std::move(lValue); @@ -352,6 +355,7 @@ Property *PropertyConstraintList::Copy(void) const void PropertyConstraintList::Paste(const Property &from) { + Base::StateLocker lock(restoreFromTransaction, true); const PropertyConstraintList& FromList = dynamic_cast(from); setValues(FromList._lValueList); } diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.h b/src/Mod/Sketcher/App/PropertyConstraintList.h index c4777bc582..a4a8eda62e 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.h +++ b/src/Mod/Sketcher/App/PropertyConstraintList.h @@ -161,6 +161,7 @@ private: std::vector validGeometryKeys; bool invalidGeometry; + bool restoreFromTransaction; void applyValues(std::vector&&); void applyValidGeometryKeys(const std::vector &keys);