From a41b2d6803ee5969776025ec219f00d9b7ef98c6 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 13 Apr 2018 14:24:11 +0200 Subject: [PATCH] Fix names of added aliases --- eeschema/dialogs/dialog_edit_component_in_lib.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_component_in_lib.cpp b/eeschema/dialogs/dialog_edit_component_in_lib.cpp index 549b6bbade..ee78eac1a7 100644 --- a/eeschema/dialogs/dialog_edit_component_in_lib.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_lib.cpp @@ -332,10 +332,9 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::EditAliasOfPart( wxCommandEvent& aEvent ) if( dlg.ShowModal() != wxID_OK ) return; // cancelled by user - aliasname = dlg.GetValue( ); - aliasname.Replace( wxT( " " ), wxT( "_" ) ); + aliasname = LIB_ID::FixIllegalChars( dlg.GetValue(), LIB_ID::ID_SCH ); - if( checkNewAlias( aliasname) ) + if( checkNewAlias( aliasname ) ) m_PartAliasListCtrl->SetString( sel, aliasname ); } @@ -349,8 +348,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddAliasOfPart( wxCommandEvent& event ) if( dlg.ShowModal() != wxID_OK ) return; // cancelled by user - aliasname = dlg.GetValue( ); - aliasname.Replace( wxT( " " ), wxT( "_" ) ); + aliasname = LIB_ID::FixIllegalChars( dlg.GetValue(), LIB_ID::ID_SCH ); if( checkNewAlias( aliasname ) ) m_PartAliasListCtrl->Append( aliasname );