Fix name escaping in symbol editor
When renaming a symbol, be sure to handle name escaping in all of the various places that we do renaming (!) Fixes https://gitlab.com/kicad/code/kicad/issues/11939
This commit is contained in:
parent
e87ba10a5a
commit
0dab566270
|
@ -306,7 +306,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// We need to keep the name and the value the same at the moment!
|
// We need to keep the name and the value the same at the moment!
|
||||||
wxString newName = m_fields->at( VALUE_FIELD ).GetText();
|
wxString newName = EscapeString( m_fields->at( VALUE_FIELD ).GetText(), CTX_LIBID );
|
||||||
wxString oldName = m_libEntry->GetName();
|
wxString oldName = m_libEntry->GetName();
|
||||||
|
|
||||||
if( oldName != newName )
|
if( oldName != newName )
|
||||||
|
|
|
@ -310,7 +310,7 @@ int SYMBOL_EDITOR_CONTROL::RenameSymbol( const TOOL_EVENT& aEvent )
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return 0; // canceled by user
|
return 0; // canceled by user
|
||||||
|
|
||||||
newName = dlg.GetValue();
|
newName = EscapeString( dlg.GetValue(), CTX_LIBID );
|
||||||
newName.Trim( true ).Trim( false );
|
newName.Trim( true ).Trim( false );
|
||||||
|
|
||||||
if( newName.IsEmpty() )
|
if( newName.IsEmpty() )
|
||||||
|
|
Loading…
Reference in New Issue