Generate safe alias names in case of name collisions

Duplicated aliases were given " (copy x)" suffix. There are two
problems: aliases cannot contain spaces and the string was translatable
which could create more issues. Now duplicated aliases receive "_x" suffix.
This commit is contained in:
Maciej Suminski 2017-11-24 17:39:58 +01:00
parent 9df938484a
commit 1d48fd28e3
1 changed files with 1 additions and 3 deletions

View File

@ -440,9 +440,7 @@ void LIB_EDIT_FRAME::fixDuplicateAliases( LIB_PART* aPart, const wxString& aLibr
while( m_libMgr->PartExists( newName, aLibrary ) )
{
wxString suffix = ( sfx == 0 ) ? wxT( " (copy)" )
: wxString::Format( _( " (copy %d)" ), sfx );
newName = alias->GetName() + suffix;
newName = wxString::Format( "%s_%d", alias->GetName(), sfx );
++sfx;
}