From: vsv Date: Thu, 26 Jun 2014 14:39:48 +0000 (+0400) Subject: Bug fixing of operations with pre-selection X-Git-Tag: V_0.4.4~222 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a04b278c149493430e5c5810469c2981597e7fe6;p=modules%2Fshaper.git Bug fixing of operations with pre-selection --- diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp index ed6ae6916..92a616504 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp +++ b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp @@ -32,8 +32,12 @@ bool ModuleBase_WidgetPoint2dDistance::setValue(ModuleBase_WidgetValue* theValue ModuleBase_WidgetValueFeature* aFeatureValue = dynamic_cast(theValue); if (aFeatureValue) { - setPoint(aFeatureValue->feature(), aFeatureValue->point()); - isDone = true; + boost::shared_ptr aPnt = aFeatureValue->point(); + FeaturePtr aFeature = aFeatureValue->feature(); + if (aFeature && aPnt) { + setPoint(aFeature, aPnt); + isDone = true; + } } } return isDone; diff --git a/src/PartSet/PartSet_OperationFeatureCreate.cpp b/src/PartSet/PartSet_OperationFeatureCreate.cpp index 6007204ac..096f56f40 100644 --- a/src/PartSet/PartSet_OperationFeatureCreate.cpp +++ b/src/PartSet/PartSet_OperationFeatureCreate.cpp @@ -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());