]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Modified methdo GetObjectPath, to take into account an input argument of type SObject
authorsrn <srn@opencascade.com>
Mon, 11 Apr 2005 10:55:12 +0000 (10:55 +0000)
committersrn <srn@opencascade.com>
Mon, 11 Apr 2005 10:55:12 +0000 (10:55 +0000)
src/SALOMEDS/SALOMEDS_Study_i.cxx

index faed4024baf36d5ed108d1c7486e55665b491ff9..c8ea13db5f3edec5956c1a41ba2565f63da474a4 100644 (file)
@@ -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);