Salome HOME
First SMESH/GEOM case OK without external Server connection
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i_1.cxx
index a667ba59fcb13a21528c624c0b2f42204b09992e..a2577de8bfe8428074df27ed729c3049ec4deca4 100644 (file)
@@ -40,7 +40,9 @@
 #include <Utils_ExceptHandlers.hxx>
 #include <SALOMEDS_wrap.hxx>
 #include <SALOMEDS_Attributes_wrap.hxx>
-#include <SALOME_KernelServices.hxx>
+#include "SALOMEDS_Study_i.hxx"
+#include "SALOME_KernelServices.hxx"
+#include "SALOME_ModuleCatalog_impl.hxx"
 
 #include <TCollection_AsciiString.hxx>
 #include <TopoDS_Solid.hxx>
@@ -215,7 +217,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(CORBA::Object_ptr theObject)
 //=======================================================================
 SALOMEDS::Study_var SMESH_Gen_i::getStudyServant()
 {
-  return SALOMEDS::Study::_duplicate(KERNEL::getStudyServant());
+  return SALOMEDS::Study::_duplicate(KERNEL::getStudyServantSA());
 }
 
 //=======================================================================
@@ -503,10 +505,9 @@ static void addReference (SALOMEDS::SObject_ptr theSObject,
  */
 //=============================================================================
 
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr /*theSObject*/,
                                                   CORBA::Object_ptr     theIOR,
                                                   const char*           theName)
-     throw (SALOME::SALOME_Exception)
 {
   Unexpect aCatch(SALOME_SalomeException);
   SALOMEDS::SObject_wrap aSO;
@@ -588,8 +589,7 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
 
   // If component for this SMESH engine does not exist in the study, create it
 
-  SALOME_ModuleCatalog::ModuleCatalog_var aCat =
-    SALOME_ModuleCatalog::ModuleCatalog::_narrow( GetNS()->Resolve("/Kernel/ModulCatalog") );
+  SALOME_ModuleCatalog::ModuleCatalog_var aCat = KERNEL::getModuleComponentServantSA();
   if ( CORBA::is_nil( aCat ) )
     return father._retn();