}
}
- // rename the study object
- Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
- aName->SetValue(Name.latin1()); // rename the SObject
- anIO->setName(Name.latin1()); // rename the InteractiveObject
+ if (!Name.isEmpty()) {
+ // rename the study object
+ Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
+ aName->SetValue(Name.latin1()); // rename the SObject
+ anIO->setName(Name.latin1()); // rename the InteractiveObject
- ViewManagerList aViewManagerList;
- getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
- SUIT_ViewManager* aViewManager = aViewManagerList.first();
- for(; aViewManager; aViewManager = aViewManagerList.next()){
- if(Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)){
- if(SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
- aViewer->renameAll( anIO, Name.latin1() );
+ ViewManagerList aViewManagerList;
+ getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
+ SUIT_ViewManager* aViewManager = aViewManagerList.first();
+ for(; aViewManager; aViewManager = aViewManagerList.next()){
+ if(Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)){
+ if(SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
+ aViewer->renameAll( anIO, Name.latin1() );
+ }
}
- }
- UpdateObjBrowser(this, false);
+ UpdateObjBrowser(this, false);
+ }
QApplication::restoreOverrideCursor();
}