mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-24 06:30:34 +05:00
Fix bug 12379: Explode BREP to entities very long. Do not check new name uniqueness in case of objects quantity > 30.
This commit is contained in:
parent
e180c20f73
commit
e666568f33
@ -759,13 +759,21 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
|
|||||||
else {
|
else {
|
||||||
const int nbObjs = objects.size();
|
const int nbObjs = objects.size();
|
||||||
bool withChildren = false;
|
bool withChildren = false;
|
||||||
|
int aNumber = 1;
|
||||||
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
|
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
|
||||||
if ( publish ) {
|
if ( publish ) {
|
||||||
QString aName("");
|
QString aName = getNewObjectName();
|
||||||
if ( nbObjs > 1 )
|
if ( nbObjs > 1 ) {
|
||||||
aName = strlen( getNewObjectName() ) ? GEOMBase::GetDefaultName( getNewObjectName() ) : GEOMBase::GetDefaultName( getPrefix( *it ) );
|
if (aName.isEmpty())
|
||||||
else {
|
aName = getPrefix(*it);
|
||||||
aName = getNewObjectName();
|
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()
|
// PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
|
||||||
if ( aName.isEmpty() )
|
if ( aName.isEmpty() )
|
||||||
aName = GEOMBase::GetDefaultName( getPrefix( *it ) );
|
aName = GEOMBase::GetDefaultName( getPrefix( *it ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user