From 368d9d98a694e1275526cd87c57136c32c67f5c5 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 19 Nov 2015 17:01:47 +0300 Subject: [PATCH] refs #734: correct construction of name for the polyline created as a result of split operation. --- src/HYDROData/HYDROData_PolylineOperator.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 { -- 2.39.2