]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
do not add a reference to useCaseBuilder twice
authoreap <eap@opencascade.com>
Mon, 18 Nov 2013 10:53:13 +0000 (10:53 +0000)
committereap <eap@opencascade.com>
Mon, 18 Nov 2013 10:53:13 +0000 (10:53 +0000)
src/SMESH_I/SMESH_Gen_i_1.cxx

index 2dc8b31bbea2c7c8902fb5c69e48a96c503e12b5..a3bc1733171339e1d0f5e16efeb89cd3e41a892a 100644 (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 );
   }
 }