From: eap Date: Wed, 20 Jun 2012 09:49:23 +0000 (+0000) Subject: 0021672: [CEA 565] Dump Study from script X-Git-Tag: V6_6_0a1~109 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f738320ebc74decc2524cf9ab17afe1d0124be35;p=modules%2Fgeom.git 0021672: [CEA 565] Dump Study from script avoid publishing multiple references to the same object --- diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index a3184ee93..fe877f791 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -753,12 +753,16 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy, if(aLength < 1) return aResultSO._retn(); //Publish the arguments + TCollection_AsciiString aPrevID; // to avoid multiple references to same object for(Standard_Integer i = 0; i< aLength; i++) { GEOM::GEOM_Object_var anObject = aList[i]; if(anObject->_is_nil()) continue; IOR = _orb->object_to_string(anObject); SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(IOR.in()); if(aSO->_is_nil()) continue; + CORBA::String_var anID = aSO->GetID(); + if ( aPrevID == anID.in() ) continue; + aPrevID = anID.in(); SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aResultSO); aStudyBuilder->Addreference(aSubSO, aSO); aSO->UnRegister();