Skip to content

Commit

Permalink
Sketcher: [skip ci] do not rename object identifier of an expression …
Browse files Browse the repository at this point in the history
…on undo/redo
  • Loading branch information
wwmayer committed May 23, 2020
1 parent 5f46999 commit 8d821fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Mod/Sketcher/App/PropertyConstraintList.cpp
Expand Up @@ -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)
{

}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Sketcher/App/PropertyConstraintList.h
Expand Up @@ -161,6 +161,7 @@ class SketcherExport PropertyConstraintList : public App::PropertyLists

std::vector<unsigned int> validGeometryKeys;
bool invalidGeometry;
bool restoreFromTransaction;

void applyValues(std::vector<Constraint*>&&);
void applyValidGeometryKeys(const std::vector<unsigned int> &keys);
Expand Down

0 comments on commit 8d821fe

Please sign in to comment.