]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
BugID: IPAL9763, modified methods NewStudy and Open to create directly CORBA Studies.
authorsrn <srn@opencascade.com>
Tue, 16 Aug 2005 09:51:29 +0000 (09:51 +0000)
committersrn <srn@opencascade.com>
Tue, 16 Aug 2005 09:51:29 +0000 (09:51 +0000)
src/SALOMEDS/SALOMEDS_StudyManager.cxx

index 2338d1fb821277da76b1378b33fd145df6363ac8..9374f0bcae850ca5717f6fd93a7c8e7f9d3f4cb9 100644 (file)
@@ -84,44 +84,32 @@ SALOMEDS_StudyManager::~SALOMEDS_StudyManager()
 
 _PTR(Study) SALOMEDS_StudyManager::NewStudy(const std::string& study_name)
 {
+  //SRN: Pure CORBA NewStudy as it does more initialization than the local one   
   SALOMEDSClient_Study* aStudy = NULL;
 
-  if(_isLocal) {
-    Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->NewStudy((char*)study_name.c_str());
-    if(aStudy_impl.IsNull()) return _PTR(Study)(aStudy);
-    aStudy = new SALOMEDS_Study(aStudy_impl);
-  }
-  else {
-    SALOMEDS::Study_var aStudy_impl = _corba_impl->NewStudy((char*)study_name.c_str());
-    if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy); 
-    aStudy = new SALOMEDS_Study(aStudy_impl);
-  }
+  SALOMEDS::Study_var aStudy_impl = _corba_impl->NewStudy((char*)study_name.c_str());
+  if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy); 
+  aStudy = new SALOMEDS_Study(aStudy_impl);
 
   return _PTR(Study)(aStudy);
 }
 
 _PTR(Study) SALOMEDS_StudyManager::Open(const std::string& theStudyUrl)
 {
+  //SRN: Pure CORBA Open as it does more initialization than the local one   
   SALOMEDSClient_Study* aStudy = NULL;
 
-  if(_isLocal) {
-    Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->Open((char*)theStudyUrl.c_str());
-    if(aStudy_impl.IsNull()) return  _PTR(Study)(aStudy);
-    aStudy = new SALOMEDS_Study(aStudy_impl);
-  }
-  else {
-    SALOMEDS::Study_var aStudy_impl = _corba_impl->Open((char*)theStudyUrl.c_str());
-    if(CORBA::is_nil(aStudy_impl)) return  _PTR(Study)(aStudy); 
+  SALOMEDS::Study_var aStudy_impl = _corba_impl->Open((char*)theStudyUrl.c_str());
+  if(CORBA::is_nil(aStudy_impl)) return  _PTR(Study)(aStudy); 
     
-    aStudy = new SALOMEDS_Study(aStudy_impl.in());
-  }
+  aStudy = new SALOMEDS_Study(aStudy_impl.in());
 
   return _PTR(Study)(aStudy);
 }
  
 void SALOMEDS_StudyManager::Close(const _PTR(Study)& theStudy)
 {
-  //SRN: Pure CORBA close as it does more cleaning then the local one
+  //SRN: Pure CORBA close as it does more cleaning than the local one
   SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId());
   _corba_impl->Close(aStudy);
 }