From: vsv Date: Fri, 6 Mar 2020 10:03:27 +0000 (+0300) Subject: Issue #18609 (Tuleap): Delete extra nodes from folder X-Git-Tag: V9_5_0a2~51 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa126a0bbe2612937563634f75190d5aa15295ed;p=modules%2Fshaper.git Issue #18609 (Tuleap): Delete extra nodes from folder --- 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(); } }