From: vsv Date: Fri, 23 May 2014 09:31:29 +0000 (+0400) Subject: Delete feature operation bugs fixing X-Git-Tag: V_0.2~16^2^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=17cb9c45dca6f3e311a874c93b9e92e7f9930ca4;p=modules%2Fshaper.git Delete feature operation bugs fixing --- diff --git a/src/XGUI/XGUI_DocumentDataModel.cpp b/src/XGUI/XGUI_DocumentDataModel.cpp index d1ca2c2ed..9cbe795c7 100644 --- a/src/XGUI/XGUI_DocumentDataModel.cpp +++ b/src/XGUI/XGUI_DocumentDataModel.cpp @@ -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); } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 3d81ef0a1..44a2c7b3c 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -814,12 +814,17 @@ void XGUI_Workshop::deleteFeatures(QFeatureList theList) } else { ObjectPtr aObject = boost::dynamic_pointer_cast(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(aFeature); + aFeature = aObject->featureRef(); + } + } aMgr->rootDocument()->removeFeature(aFeature); } aMgr->rootDocument()->finishOperation();