Salome HOME
IMP 0019918: Re-open popup for imported shapes.
[modules/geom.git] / src / RepairGUI / RepairGUI_DivideEdgeDlg.cxx
index 9ba9969bc231bee0a6d7a140586e3a3de621f651..7cea1fd993597e5fb4f4f6a0d2fb9c7dc7ebae01 100644 (file)
@@ -221,8 +221,12 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
 
   myObject = GEOM::GEOM_Object::_nil();
 
-  if ( IObjectCount() == 1 ) {
-    Handle(SALOME_InteractiveObject) anIO = firstIObject();
+  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+  SALOME_ListIO aSelList;
+  aSelMgr->selectedObjects(aSelList);
+
+  if ( aSelList.Extent() == 1 ) {
+    Handle(SALOME_InteractiveObject) anIO = aSelList.First();
     Standard_Boolean aRes;
     GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
     if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
@@ -235,9 +239,7 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
           GEOM::short_array anIndexes;
 
           TColStd_IndexedMapOfInteger aMap;
-          SalomeApp_Application* anApp =
-            (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
-          anApp->selectionMgr()->GetIndexes( anIO, aMap );
+          aSelMgr->GetIndexes( anIO, aMap );
 
           if ( aMap.Extent() == 1 ) { // local selection
             int anIndex = aMap( 1 );