Sketcher: [skip ci] do not rename object identifier of an expression on undo/redo

This commit is contained in:
wmayer
2020-05-23 21:30:02 +02:00
parent 6a3b2a02f5
commit 1803c4df0e
2 changed files with 8 additions and 3 deletions

View File

@@ -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<Constraint*>&& 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<const PropertyConstraintList&>(from);
setValues(FromList._lValueList);
}

View File

@@ -161,6 +161,7 @@ private:
std::vector<unsigned int> validGeometryKeys;
bool invalidGeometry;
bool restoreFromTransaction;
void applyValues(std::vector<Constraint*>&&);
void applyValidGeometryKeys(const std::vector<unsigned int> &keys);