From: mkr Date: Thu, 19 Nov 2015 14:01:47 +0000 (+0300) Subject: refs #734: correct construction of name for the polyline created as a result of split... X-Git-Tag: v1.5~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=368d9d98a694e1275526cd87c57136c32c67f5c5;p=modules%2Fhydro.git refs #734: correct construction of name for the polyline created as a result of split operation. --- diff --git a/src/HYDROData/HYDROData_PolylineOperator.cxx b/src/HYDROData/HYDROData_PolylineOperator.cxx index 6dbbd745..b991bf7f 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.cxx +++ b/src/HYDROData/HYDROData_PolylineOperator.cxx @@ -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 {