]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix undo of arc creation (issue #1166)
authorazv <azv@opencascade.com>
Wed, 23 Dec 2015 13:10:53 +0000 (16:10 +0300)
committerazv <azv@opencascade.com>
Wed, 23 Dec 2015 13:10:53 +0000 (16:10 +0300)
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp

index 23c4995e6f94a9ab4c3b0b604d4c2c0fab203889..e5e79492b84924e6569f03b5713ddade242e678d 100644 (file)
@@ -1530,15 +1530,20 @@ bool SolveSpaceSolver_Storage::removeCoincidence(ConstraintWrapperPtr theConstra
   std::map<FeaturePtr, EntityWrapperPtr>::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<EntityWrapperPtr> aSubs = aFIt->second->subEntities();
       std::list<EntityWrapperPtr>::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