From: srn Date: Mon, 11 Apr 2005 10:55:12 +0000 (+0000) Subject: Modified methdo GetObjectPath, to take into account an input argument of type SObject X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6b8b29b76631bf3babe863885756988c4eedbb8f;p=modules%2Fkernel.git Modified methdo GetObjectPath, to take into account an input argument of type SObject --- diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index faed4024b..c8ea13db5 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -246,8 +246,16 @@ char* SALOMEDS_Study_i::GetObjectPath(CORBA::Object_ptr theObject) TCollection_AsciiString aPath(""); if(CORBA::is_nil(theObject)) return CORBA::string_dup(aPath.ToCString()); + Handle(SALOMEDSImpl_SObject) aSO; + SALOMEDS::SObject_var aSObj = SALOMEDS::SObject::_narrow(theObject); - Handle(SALOMEDSImpl_SObject) aSO = _impl->FindObjectIOR(_orb->object_to_string(theObject)); + if(!CORBA::is_nil(aSObj)) { + aSO = _impl->FindObjectID(aSObj->GetID()); + } + else { + aSO = _impl->FindObjectIOR(_orb->object_to_string(theObject)); + } + if(aSO.IsNull()) return CORBA::string_dup(aPath.ToCString()); aPath = _impl->GetObjectPath(aSO);