From: apo Date: Wed, 17 Jan 2007 13:57:59 +0000 (+0000) Subject: To fix crash on "Rename" & "Cancel" X-Git-Tag: WP1_2_3_17-01-2007_Data_format_at_entry_of_visualization_pipeline~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13699e9eac8a691d5e47e5f9e2f5d46c118e3397;p=modules%2Fvisu.git To fix crash on "Rename" & "Cancel" --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index c3783b2a..a579baba 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1518,22 +1518,24 @@ VisuGUI } } - // 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(aViewManager)){ - if(SPlot2d_Viewer* aViewer = dynamic_cast(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(aViewManager)){ + if(SPlot2d_Viewer* aViewer = dynamic_cast(aManager->getViewModel())) + aViewer->renameAll( anIO, Name.latin1() ); + } } - } - UpdateObjBrowser(this, false); + UpdateObjBrowser(this, false); + } QApplication::restoreOverrideCursor(); }