From 1d48fd28e3ce93645a8fb05852e2912114e7773e Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 24 Nov 2017 17:39:58 +0100 Subject: [PATCH] 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. --- eeschema/libedit.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index ee779a7bdd..e438c44120 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -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; }