]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #734: correct construction of name for the polyline created as a result of split...
authormkr <mkr@opencascade.com>
Thu, 19 Nov 2015 14:01:47 +0000 (17:01 +0300)
committermkr <mkr@opencascade.com>
Thu, 19 Nov 2015 14:01:47 +0000 (17:01 +0300)
src/HYDROData/HYDROData_PolylineOperator.cxx

index 6dbbd74562279b6c59b9958cf67c250f233b92e2..b991bf7f6992a0728f13c55e2e93e11940eb3cea 100644 (file)
@@ -306,9 +306,12 @@ bool HYDROData_PolylineOperator::CreatePolylines( const Handle( HYDROData_Docume
     if( isUseIndices )
     {
       QString aNewName = theNamePrefix + "_" + QString::number( anIndex );
-      if( theDoc->FindObjectByName( aNewName ).IsNull() )  // the object with such a name is not found
-        aPolyline->SetName( aNewName );
-      anIndex++;
+      while( !theDoc->FindObjectByName( aNewName ).IsNull() )  // the object with such a name is not found
+      {
+        anIndex++;
+        aNewName = theNamePrefix + "_" + QString::number( anIndex );
+      }
+      aPolyline->SetName( aNewName );
     }
     else
     {