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;
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();
}
}