From: srn Date: Tue, 16 Aug 2005 09:51:29 +0000 (+0000) Subject: BugID: IPAL9763, modified methods NewStudy and Open to create directly CORBA Studies. X-Git-Tag: T_3_0_2a1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e449a86846e4c6b0161d745f7e5f3231f2b255df;p=modules%2Fkernel.git BugID: IPAL9763, modified methods NewStudy and Open to create directly CORBA Studies. --- diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index 2338d1fb8..9374f0bca 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -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); }