From 822fd0d3ffbff08fb9d22fc9a625cc0cb1fc352c Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 16 May 2014 11:19:40 +0400 Subject: [PATCH] Fix of crash on Undo command --- src/XGUI/XGUI_DocumentDataModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } } -- 2.39.2