]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Delete feature operation bugs fixing
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 23 May 2014 09:31:29 +0000 (13:31 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 23 May 2014 09:31:29 +0000 (13:31 +0400)
src/XGUI/XGUI_DocumentDataModel.cpp
src/XGUI/XGUI_Workshop.cpp

index d1ca2c2ed4b895c46237f14eeb63322c674fe33b..9cbe795c7682a9e3f98c0431986e86cc194d5180 100644 (file)
@@ -117,7 +117,7 @@ void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage)
         }
         if (aPartModel) {
           QModelIndex aIndex = aPartModel->findGroup(aGroup);
-          int aStart = aPartModel->rowCount(aIndex);
+          int aStart = aPartModel->rowCount(aIndex) - 1;
           aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex));
           removeRow(aStart, aIndex);
         }
index 3d81ef0a15e7670889dc5858d23c0a29e6a5a3a0..44a2c7b3cacec0e92ce5c1591cce3612e97351c5 100644 (file)
@@ -814,12 +814,17 @@ void XGUI_Workshop::deleteFeatures(QFeatureList theList)
         } else {
           ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
           aDoc = aObject->featureRef()->data()->docRef("PartDocument")->value();
+          aFeature = aObject->featureRef();
         }
         if (aDoc == aMgr->currentDocument()) {
           aDoc->close();
         }
-      } //else
-        //aDoc = aFeature->document();
+      } else {
+        if (!aFeature->data()) {
+          ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
+          aFeature = aObject->featureRef();
+        }
+      }
       aMgr->rootDocument()->removeFeature(aFeature);
     }
     aMgr->rootDocument()->finishOperation();