X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMEDS%2FSALOMEDS_Study.cxx;h=8f438d9f4ea55151182b1b355dce427dcfeb514a;hb=8469d4f02c5b4379665d4ec1b07709d3c8411114;hp=2a14971d7f632ed0283c3130f02e220456d8bd80;hpb=f91bb8bf5cb60da9732f42320b208236a198311f;p=modules%2Fkernel.git diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 2a14971d7..8f438d9f4 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -53,8 +53,7 @@ #include "SALOMEDS_Driver_i.hxx" #include "SALOMEDS_Study_i.hxx" -#include "Utils_ORB_INIT.hxx" -#include "Utils_SINGLETON.hxx" +#include "OpUtil.hxx" #include "Basics_Utils.hxx" @@ -105,9 +104,7 @@ SALOMEDS_Study::~SALOMEDS_Study() void SALOMEDS_Study::InitORB() { - ORB_INIT &init = *SINGLETON_::Instance(); - ASSERT(SINGLETON_::IsAlreadyExisting()); - _orb = init(0 , 0 ) ; + _orb = KERNEL::GetRefToORB(); } void SALOMEDS_Study::Init() @@ -132,10 +129,16 @@ bool SALOMEDS_Study::Open(const std::string& theStudyUrl) return false; std::wstring wtheStudyUrl = Kernel_Utils::decode_s( theStudyUrl ); - if (!_corba_impl->Open( (wchar_t*)wtheStudyUrl.c_str() ) ) - return false; + return _corba_impl->Open( (wchar_t*)wtheStudyUrl.c_str() ); +} - return true; +bool SALOMEDS_Study::CanOpen(const std::string& theStudyUrl) +{ + if(CORBA::is_nil(_corba_impl)) + return false; + std::wstring wtheStudyUrl = Kernel_Utils::decode_s( theStudyUrl ); + + return _corba_impl->CanOpen( (wchar_t*)wtheStudyUrl.c_str() ); } bool SALOMEDS_Study::Save(bool theMultiFile, bool theASCII) @@ -347,7 +350,7 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindObjectByName(const std::string& a SALOMEDS::Locker lock; std::vector aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName); - aLength = aSeq.size(); + aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int for (i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i]))); } @@ -588,7 +591,7 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& std::vector aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl())); if (aSeq.size()) { - aLength = aSeq.size(); + aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int for (i = 0; i < aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i]))); }