]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Bug fixing of operations with pre-selection
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 26 Jun 2014 14:39:48 +0000 (18:39 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 26 Jun 2014 14:39:48 +0000 (18:39 +0400)
src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp
src/PartSet/PartSet_OperationFeatureCreate.cpp

index ed6ae6916f52e3e4e992a41f848762d8dba03173..92a616504c22183c9ab457d84f1f1bdfad7eefdd 100644 (file)
@@ -32,8 +32,12 @@ bool ModuleBase_WidgetPoint2dDistance::setValue(ModuleBase_WidgetValue* theValue
     ModuleBase_WidgetValueFeature* aFeatureValue = 
                          dynamic_cast<ModuleBase_WidgetValueFeature*>(theValue);
     if (aFeatureValue) {
-      setPoint(aFeatureValue->feature(), aFeatureValue->point());
-      isDone = true;
+      boost::shared_ptr<GeomAPI_Pnt2d> aPnt = aFeatureValue->point();
+      FeaturePtr aFeature = aFeatureValue->feature();
+      if (aFeature && aPnt) {
+        setPoint(aFeature, aPnt);
+        isDone = true;
+      }
     }
   }
   return isDone;
index 6007204aceb6430ef319c986ccb056299073bc39..096f56f40eb1febed05833eeef5e3e8c94f4c304 100644 (file)
@@ -189,7 +189,7 @@ void PartSet_OperationFeatureCreate::keyReleased(std::string theName, QKeyEvent*
 void PartSet_OperationFeatureCreate::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
 {
   myActiveWidget = theWidget;
-  if (myPreSelection.size() > 0) {
+  if ((myPreSelection.size() > 0) && myActiveWidget) {
     const XGUI_ViewerPrs& aPrs = myPreSelection.front();
     ModuleBase_WidgetValueFeature aValue;
     aValue.setFeature(aPrs.feature());