From: azv Date: Wed, 23 Dec 2015 13:10:53 +0000 (+0300) Subject: Fix undo of arc creation (issue #1166) X-Git-Tag: V_2.1.0~93 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9381c1b7f9323a6ca688b8d4d4a4ec5760d95bc8;p=modules%2Fshaper.git Fix undo of arc creation (issue #1166) --- diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp index 23c4995e6..e5e79492b 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp @@ -1530,15 +1530,20 @@ bool SolveSpaceSolver_Storage::removeCoincidence(ConstraintWrapperPtr theConstra std::map::iterator aFIt = myFeatureMap.begin(); for (; aFIt != myFeatureMap.end(); ++aFIt) { for (aNotCIt = aNotCoinc.begin(); aNotCIt != aNotCoinc.end(); ++aNotCIt) { - if (!aFIt->second->isUsed(aNotCIt->first->baseAttribute())) + if (!aNotCIt->second || !aFIt->second->isUsed(aNotCIt->first->baseAttribute())) continue; std::list aSubs = aFIt->second->subEntities(); std::list::iterator aSIt = aSubs.begin(); + bool isUpd = false; for (; aSIt != aSubs.end(); ++aSIt) - if (*aSIt == aNotCIt->first) + if (*aSIt == aNotCIt->first) { *aSIt = aNotCIt->second; - aFIt->second->setSubEntities(aSubs); - anUpdFeatures.insert(aFIt->second); + isUpd = true; + } + if (isUpd) { + aFIt->second->setSubEntities(aSubs); + anUpdFeatures.insert(aFIt->second); + } } } // update features