From: vsv Date: Tue, 26 May 2015 12:18:16 +0000 (+0300) Subject: Remove index of history item in part data tree X-Git-Tag: V_1.2.0~72 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=50731891a72a762111e7a65f7de233ebe03655ad;p=modules%2Fshaper.git Remove index of history item in part data tree --- diff --git a/src/PartSet/PartSet_DocumentDataModel.cpp b/src/PartSet/PartSet_DocumentDataModel.cpp index 961768c18..8d2eea905 100644 --- a/src/PartSet/PartSet_DocumentDataModel.cpp +++ b/src/PartSet/PartSet_DocumentDataModel.cpp @@ -155,9 +155,15 @@ void PartSet_DocumentDataModel::processEvent(const std::shared_ptrfindGroup(aGroup); - int aStart = aPartModel->rowCount(aIndex); - aIndex = createIndex(aIndex.row(), aIndex.column(), (void*) getModelIndex(aIndex)); - removeRow(aStart, aIndex); + if (aIndex.isValid()) { + int aStart = aPartModel->rowCount(aIndex); + aIndex = createIndex(aIndex.row(), aIndex.column(), (void*) getModelIndex(aIndex)); + removeRow(aStart, aIndex); + } else { + int aRow = aPartModel->rowCount(); + aIndex = createIndex(aPartModel->position() + historyOffset(), 0, HistoryNode); + removeRow(aRow, aIndex); + } } } }