// remove Z layer
aClone->RemoveZLevel();
-
- // generate a new unique name for the clone object:
- // case 1: Image_1 -> Image_2
- // case 2: ImageObj -> ImageObj_1
- QString aName = aClone->GetName();
- QString aPrefix = aName;
- if( aName.contains( '_' ) ) // case 1
- {
- QString aSuffix = aName.section( '_', -1 );
- bool anIsInteger = false;
- aSuffix.toInt( &anIsInteger );
- if( anIsInteger )
- aPrefix = aName.section( '_', 0, -2 );
- }
- else // case 2
- aPrefix = aName;
- aName = HYDROGUI_Tool::GenerateObjectName( (HYDROGUI_Module*)module(), aPrefix );
- aClone->SetName( aName );
}
}
}