]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Multi-selection widget to be used in the extrusion feature.
authornds <natalia.donis@opencascade.com>
Tue, 17 Mar 2015 14:48:24 +0000 (17:48 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 17 Mar 2015 14:48:24 +0000 (17:48 +0300)
Crash fix.

src/PartSet/PartSet_WidgetShapeSelector.cpp

index 44962e5908797247b8fa9ee32d351d5ae0844587..93aac5e0c8b900965f12ed1cfe6a1c7b5ef26155 100644 (file)
@@ -20,15 +20,12 @@ bool PartSet_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObje
   ObjectPtr aSelectedObject = theSelectedObject;
   GeomShapePtr aShape = theShape;
 
-  if (!aSelectedObject)
-    return false;
-
   FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(aSelectedObject);
   if (aSelectedFeature == myFeature)  // In order to avoid selection of the same object
     return false;
   std::shared_ptr<SketchPlugin_Feature> aSPFeature = 
           std::dynamic_pointer_cast<SketchPlugin_Feature>(aSelectedFeature);
-  if ((!aSPFeature) && (!aShape->isNull())) {
+  if (aSPFeature.get() != NULL && aShape.get() != NULL && !aShape->isNull()) {
     // Processing of external (non-sketch) object
     ObjectPtr aObj = PartSet_Tools::createFixedObjectByExternal(aShape->impl<TopoDS_Shape>(),
                                                                 aSelectedObject, mySketch);
@@ -56,7 +53,6 @@ bool PartSet_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObje
           aRefAttr->setAttr(aPntAttr);
         else if (aSelectedObject)
           aRefAttr->setObject(aSelectedObject);
-        //updateObject(myFeature);
         return true;
       }
     }
@@ -64,4 +60,3 @@ bool PartSet_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObje
   return ModuleBase_WidgetShapeSelector::storeAttributeValues(aSelectedObject, aShape);
 }
 
-