From: jfa Date: Wed, 10 May 2006 14:26:06 +0000 (+0000) Subject: Fix bug 12379: Explode BREP to entities very long. Do not check new name uniqueness... X-Git-Tag: T3_2_0b1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e666568f33a97949070c1c6e3da25f65f87beaf0;p=modules%2Fgeom.git Fix bug 12379: Explode BREP to entities very long. Do not check new name uniqueness in case of objects quantity > 30. --- diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index c8201fc5f..9d65029f8 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -759,13 +759,21 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction ) else { const int nbObjs = objects.size(); bool withChildren = false; + int aNumber = 1; for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) { if ( publish ) { - QString aName(""); - if ( nbObjs > 1 ) - aName = strlen( getNewObjectName() ) ? GEOMBase::GetDefaultName( getNewObjectName() ) : GEOMBase::GetDefaultName( getPrefix( *it ) ); - else { - aName = getNewObjectName(); + QString aName = getNewObjectName(); + if ( nbObjs > 1 ) { + if (aName.isEmpty()) + aName = getPrefix(*it); + if (nbObjs <= 30) { + // Try to find a unique name + aName = GEOMBase::GetDefaultName(aName); + } else { + // Don't check name uniqueness in case of numerous objects + aName = aName + "_" + QString::number(aNumber++); + } + } else { // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() if ( aName.isEmpty() ) aName = GEOMBase::GetDefaultName( getPrefix( *it ) );