Salome HOME
Issue #1618 naming in sketch is broken: external object creation should use the shape...
[modules/shaper.git] / src / PartSet / PartSet_WidgetShapeSelector.cpp
index a502fcdfa0cda24aa8c07f54eb5e3d53c7ef80bc..e815b7dc945d8c0c1a2fa69a9b0a156aaa430fb5 100755 (executable)
@@ -79,7 +79,7 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr
   // there is no a sketch feature is selected, but the shape exists, try to create an exernal object
   // TODO: unite with the same functionality in PartSet_WidgetShapeSelector
   if (aSPFeature.get() == NULL) {
-    theObject = ObjectPtr();
+    ObjectPtr anExternalObject = ObjectPtr();
     if (myExternalObjectMgr->useExternal()) {
       GeomShapePtr aShape = theShape;
       if (!aShape.get()) {
@@ -88,8 +88,11 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr
           aShape = aResult->shape();
       }
       if (aShape.get() != NULL && !aShape->isNull())
-        theObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate);
+        anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate);
     }
+    /// the object is null if the selected feature is "external"(not sketch entity feature of the
+    /// current sketch) and it is not created by object manager
+    theObject = anExternalObject;
   }
 }