From f738320ebc74decc2524cf9ab17afe1d0124be35 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Jun 2012 09:49:23 +0000 Subject: [PATCH] 0021672: [CEA 565] Dump Study from script avoid publishing multiple references to the same object --- src/GEOM_I/GEOM_Gen_i.cc | 4 ++++ 1 file changed, 4 insertions(+) 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(); -- 2.39.2