]> SALOME platform Git repositories - modules/kernel.git/blobdiff - src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx
Salome HOME
updated copyright message
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_UseCaseBuilder.cxx
index 2ae8c8c0920ebdd15402462d7cf34d33100f294d..6c00f01a73e03e2922ae47457f3ac7a8ccb3ce2f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -173,7 +173,7 @@ bool SALOMEDSImpl_UseCaseBuilder::Remove(const SALOMEDSImpl_SObject& theObject)
   for(; aChildItr.More(); aChildItr.Next())
     aList.push_back(aChildItr.Value());
 
-  for(int i = 0, len = aList.size(); i<len; i++) {
+  for(size_t i = 0, len = aList.size(); i<len; i++) {
     if(aList[i]->Label() ==  aCurrent) { //The current node is removed
       aRef->Set(_root->Label()); //Reset the current node to the root
     }
@@ -272,11 +272,9 @@ int SALOMEDSImpl_UseCaseBuilder::GetIndexInFather(const SALOMEDSImpl_SObject& th
   if ( index < 0 )
   {
     SALOMEDSImpl_AttributeTreeNode* Last = aFather->GetFirst();
-    for ( index = 0; Last && Last->HasNext(); ++index )
+    for ( index = 0; Last && aNode != Last && Last->HasNext(); ++index )
     {
       Last = Last->GetNext();
-      if ( aNode == Last )
-        break;
     }
     if ( Last != aNode )
       index = -1;