From: vsv Date: Fri, 16 May 2014 07:19:40 +0000 (+0400) Subject: Fix of crash on Undo command X-Git-Tag: V_0.2~49^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=822fd0d3ffbff08fb9d22fc9a625cc0cb1fc352c;p=modules%2Fshaper.git Fix of crash on Undo command --- diff --git a/src/XGUI/XGUI_DocumentDataModel.cpp b/src/XGUI/XGUI_DocumentDataModel.cpp index 7962105ca..c5b0cbd9b 100644 --- a/src/XGUI/XGUI_DocumentDataModel.cpp +++ b/src/XGUI/XGUI_DocumentDataModel.cpp @@ -92,12 +92,12 @@ void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage) if (aUpdMsg->group().compare(PARTS_GROUP) == 0) { // Updsate only Parts group int aStart = myPartModels.size(); removeSubModel(myPartModels.size() - 1); - removeRow(aStart - 1, partFolderNode()); + removeRow(aStart, partFolderNode()); } else { // Update top groups (other except parts QModelIndex aIndex = myModel->findGroup(aUpdMsg->group()); int aStart = myModel->rowCount(aIndex); aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex)); - removeRow(aStart - 1, aIndex); + removeRow(aStart, aIndex); } } else { XGUI_PartModel* aPartModel = 0; @@ -112,7 +112,7 @@ void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage) QModelIndex aIndex = aPartModel->findGroup(aUpdMsg->group()); int aStart = aPartModel->rowCount(aIndex); aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex)); - removeRow(aStart - 1, aIndex); + removeRow(aStart, aIndex); } }