From 849a4656c85cfedceff3440d08ac2eb486716293 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 14 Sep 2023 23:54:04 +0100 Subject: [PATCH] Check value-follows-name case in symbol Save As. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15647 --- eeschema/symbol_editor/symbol_editor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index f9146f35d3..7770dab7b3 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -663,6 +663,7 @@ void SYMBOL_EDIT_FRAME::saveSymbolAs() LIB_ID old_lib_id = symbol->GetLibId(); wxString symbolName = old_lib_id.GetLibItemName(); wxString libraryName = old_lib_id.GetLibNickname(); + bool valueFollowsName = symbol->GetValueField().GetText() == symbolName; wxString msg; bool done = false; @@ -730,6 +731,9 @@ void SYMBOL_EDIT_FRAME::saveSymbolAs() LIB_SYMBOL new_symbol( *symbol ); new_symbol.SetName( symbolName ); + if( valueFollowsName ) + new_symbol.GetValueField().SetText( symbolName ); + m_libMgr->UpdateSymbol( &new_symbol, libraryName ); SyncLibraries( false ); m_treePane->GetLibTree()->SelectLibId( LIB_ID( libraryName, new_symbol.GetName() ) );