From 3e7e2a9bc4ccbe5913dabcad1297589a17b7117f Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 23 Sep 2020 16:59:23 +0200 Subject: [PATCH] Sketcher: [skip ci] fix undo bug when directly changing a datum constraint in the property editor --- src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp index fcf2772379..411cb4fe3f 100644 --- a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp +++ b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp @@ -23,6 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include # include # include #endif @@ -337,8 +338,9 @@ bool PropertyConstraintListItem::event (QEvent* ev) double datum = quant.getValue(); if ((*it)->Type == Sketcher::Angle) datum = Base::toRadians(datum); - const_cast((*it))->setValue(datum); - item->set1Value(id,(*it)); + std::unique_ptr copy((*it)->clone()); + copy->setValue(datum); + item->set1Value(id, copy.get()); break; } }