From 76bbc8025e61fdde7ab396c9399852b2a1ae2f87 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 23 May 2014 14:09:53 +0400 Subject: [PATCH] Fix of delete feature operation --- src/XGUI/XGUI_DocumentDataModel.cpp | 2 +- src/XGUI/XGUI_Workshop.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/XGUI/XGUI_DocumentDataModel.cpp b/src/XGUI/XGUI_DocumentDataModel.cpp index 9cbe795c7..d1ca2c2ed 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) - 1; + int aStart = aPartModel->rowCount(aIndex); 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 44a2c7b3c..389f81420 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -825,7 +825,7 @@ void XGUI_Workshop::deleteFeatures(QFeatureList theList) aFeature = aObject->featureRef(); } } - aMgr->rootDocument()->removeFeature(aFeature); + aFeature->document()->removeFeature(aFeature); } aMgr->rootDocument()->finishOperation(); } -- 2.39.2