]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix of crash on Undo command
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 16 May 2014 07:19:40 +0000 (11:19 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 16 May 2014 07:19:40 +0000 (11:19 +0400)
src/XGUI/XGUI_DocumentDataModel.cpp

index 7962105ca1f2221b7b8e33474741e29ae6259ed6..c5b0cbd9b78454fbfddba3bf2e6fd96b65a218e4 100644 (file)
@@ -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);
       }
     }