X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PolylineOperator.cxx;h=b991bf7f6992a0728f13c55e2e93e11940eb3cea;hb=cde2ec476486fcd7c9b7b38ce814c648d73e7fd3;hp=6dbbd74562279b6c59b9958cf67c250f233b92e2;hpb=c3aaf9774d926aa6095597b4d52a8858dc0898c5;p=modules%2Fhydro.git 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 {