From 0db65235fe81be5948188a833275a25255148d17 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 22 Dec 2015 17:07:27 +0300 Subject: [PATCH] Fix regressions in test cases --- src/SketchSolver/SketchSolver_Storage.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SketchSolver/SketchSolver_Storage.cpp b/src/SketchSolver/SketchSolver_Storage.cpp index f5617bbea..acefc6396 100644 --- a/src/SketchSolver/SketchSolver_Storage.cpp +++ b/src/SketchSolver/SketchSolver_Storage.cpp @@ -92,9 +92,11 @@ void SketchSolver_Storage::addEntity(FeaturePtr theFeature, std::list::const_iterator anAttrIt = aPntAttrs.begin(); for (; anAttrIt != aPntAttrs.end(); ++anAttrIt) addEntity(*anAttrIt, EntityWrapperPtr()); - } + if (aFound == myFeatureMap.end()) + myFeatureMap[theFeature] = theSolverEntity; + } else + myFeatureMap[theFeature] = theSolverEntity; - myFeatureMap[theFeature] = theSolverEntity; // block events if necessary if (myEventsBlocked && theFeature->data() && theFeature->data()->isValid()) theFeature->data()->blockSendAttributeUpdated(myEventsBlocked); @@ -108,7 +110,8 @@ void SketchSolver_Storage::addEntity(AttributePtr theAttribute, (theSolverEntity && !aFound->second->isEqual(theSolverEntity))) setNeedToResolve(true); // the entity is new or modified - myAttributeMap[theAttribute] = theSolverEntity; + if (theSolverEntity || aFound == myAttributeMap.end()) + myAttributeMap[theAttribute] = theSolverEntity; // block events if necessary if (myEventsBlocked && theAttribute->owner() && theAttribute->owner()->data() && theAttribute->owner()->data()->isValid()) -- 2.39.2