]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#refs 76 - reported by Hervé Legrand: Edit Sketch as Constructions child - crash
authornds <natalia.donis@opencascade.com>
Mon, 2 Jun 2014 03:45:16 +0000 (07:45 +0400)
committernds <natalia.donis@opencascade.com>
Mon, 2 Jun 2014 03:45:16 +0000 (07:45 +0400)
In additional isModelObject() method is added.
The bug functionality is in Module::edit(). The feature is obtained from the model object if it is.

src/XGUI/XGUI_Workshop.cpp

index 6ec130cc75971b348bbfa602a03530f4de1e8a34..f42b21c69a41f8fdcf26aea258a334b97feaafe2 100644 (file)
@@ -738,7 +738,6 @@ void XGUI_Workshop::changeCurrentDocument(FeaturePtr thePart)
   if (thePart) {
     DocumentPtr aFeaDoc;
     if (!XGUI_Tools::isModelObject(thePart)) {
-    //if (thePart->data()) {
       aFeaDoc = thePart->data()->docRef("PartDocument")->value();
     } else {
       ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(thePart);
@@ -806,7 +805,6 @@ void XGUI_Workshop::deleteFeatures(QFeatureList theList)
       if (aFeature->getKind() == "Part") {
         DocumentPtr aDoc;
         if (!XGUI_Tools::isModelObject(aFeature)) {
-        //if (aFeature->data()) {
           aDoc = aFeature->data()->docRef("PartDocument")->value();
         } else {
           ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
@@ -818,7 +816,6 @@ void XGUI_Workshop::deleteFeatures(QFeatureList theList)
         }
       } else {
         if (XGUI_Tools::isModelObject(aFeature)) {
-        //if (!aFeature->data()) {
           ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
           aFeature = aObject->featureRef();
         }