do not add a reference to useCaseBuilder twice

This commit is contained in:
eap 2013-11-18 10:53:13 +00:00
parent fc83dc7660
commit 68cf640188

View File

@ -412,12 +412,14 @@ static void addReference (SALOMEDS::Study_ptr theStudy,
theTag = tag;
}
if ( !theSObject->FindSubObject( theTag, aReferenceSO.inout() ))
{
aReferenceSO = aStudyBuilder->NewObjectToTag( theSObject, theTag );
// add reference to the use case tree
// (to support tree representation customization and drag-n-drop)
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
useCaseBuilder->AppendTo( aReferenceSO->GetFather(), aReferenceSO );
}
aStudyBuilder->Addreference( aReferenceSO, aToObjSO );
// add reference to the use case tree
// (to support tree representation customization and drag-n-drop)
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
useCaseBuilder->AppendTo( aReferenceSO->GetFather(), aReferenceSO );
}
}