From aa126a0bbe2612937563634f75190d5aa15295ed Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 6 Mar 2020 13:03:27 +0300 Subject: [PATCH] Issue #18609 (Tuleap): Delete extra nodes from folder --- src/PartSet/PartSet_TreeNodes.cpp | 2 +- src/XGUI/XGUI_ObjectsBrowser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index e886365e2..dcd74cf6c 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -1083,7 +1083,7 @@ void PartSet_ObjectFolderNode::update() int aNbOfFeatures = aDoc->size(ModelAPI_Feature::group(), true); while (aId < myChildren.size()) { ModuleBase_ITreeNode* aNode = myChildren.at(aId); - if ((aFirst + aId) < aNbOfFeatures) { + if ((aId < aNbItems) && ((aFirst + aId) < aNbOfFeatures)) { if (aNode->object() != aDoc->object(ModelAPI_Feature::group(), aFirst + aId)) { myChildren.removeAll(aNode); delete aNode; diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 75543ff5c..754034d3a 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -131,7 +131,7 @@ void XGUI_DataTree::commitData(QWidget* theEditor) if (XGUI_Tools::canRename(aObj, aName)) { SessionPtr aMgr = ModelAPI_Session::get(); aMgr->startOperation("Rename"); - aObj->data()->setName(qPrintable(aName)); + aObj->data()->setName(aName.toStdString()); aMgr->finishOperation(); } } -- 2.39.2