From: mpv Date: Mon, 26 May 2014 11:27:12 +0000 (+0400) Subject: Fixed crash on exotic case: many undo-redo on sketch entity and after selection of... X-Git-Tag: V_0.2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ba123816d90f754f7852ac08aad034af4081961;p=modules%2Fshaper.git Fixed crash on exotic case: many undo-redo on sketch entity and after selection of appeared object --- diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp b/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp index 01f9902eb..623eaae63 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp +++ b/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -70,6 +71,10 @@ ModuleBase_WidgetPoint2D::~ModuleBase_WidgetPoint2D() bool ModuleBase_WidgetPoint2D::storeValue(boost::shared_ptr theFeature) { boost::shared_ptr aData = theFeature->data(); + if (!aData) { + ObjectPtr anObj = boost::dynamic_pointer_cast(theFeature); + if (anObj) aData = anObj->featureRef()->data(); + } boost::shared_ptr aPoint = boost::dynamic_pointer_cast(aData->attribute(myFeatureAttributeID)); @@ -84,6 +89,10 @@ bool ModuleBase_WidgetPoint2D::storeValue(boost::shared_ptr th bool ModuleBase_WidgetPoint2D::restoreValue(boost::shared_ptr theFeature) { boost::shared_ptr aData = theFeature->data(); + if (!aData) { + ObjectPtr anObj = boost::dynamic_pointer_cast(theFeature); + if (anObj) aData = anObj->featureRef()->data(); + } boost::shared_ptr aPoint = boost::dynamic_pointer_cast(aData->attribute(myFeatureAttributeID));