Browse Source

Escape symbols when adding to library

Can't escape by default because the allowed characters differ in the
read-only libraries and existing schematics that reference them.  So,
escape when we import into standard KiCad Libraries

Fixes https://gitlab.com/kicad/code/kicad/issues/9419
6.0.7
Seth Hillbrand 4 years ago
parent
commit
512ba167e8
  1. 6
      eeschema/symbol_editor/symbol_editor_import_export.cpp

6
eeschema/symbol_editor/symbol_editor_import_export.cpp

@ -91,7 +91,9 @@ void SYMBOL_EDIT_FRAME::ImportSymbol()
wxString symbolName = symbols[0];
LIB_SYMBOL* entry = pi->LoadSymbol( fn.GetFullPath(), symbolName );
if( m_libMgr->SymbolExists( symbols[0], libName ) )
entry->SetName( EscapeString( entry->GetName(), CTX_LIBID ) );
if( m_libMgr->SymbolExists( entry->GetName(), libName ) )
{
msg.Printf( _( "Symbol %s already exists in library '%s'." ), symbolName, libName );
@ -105,7 +107,7 @@ void SYMBOL_EDIT_FRAME::ImportSymbol()
m_libMgr->UpdateSymbol( entry, libName );
SyncLibraries( false );
LoadSymbol( symbolName, libName, 1 );
LoadSymbol( entry->GetName(), libName, 1 );
}

Loading…
Cancel
Save