From 68cf64018844347b47a97d6dfe0b6926ee68cc01 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 18 Nov 2013 10:53:13 +0000 Subject: [PATCH] do not add a reference to useCaseBuilder twice --- src/SMESH_I/SMESH_Gen_i_1.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 2dc8b31bb..a3bc17331 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -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 ); } }