From db44690460bae3bd300ca720bbd4c9f139ce7a6c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 14 Feb 2025 20:25:11 +0000 Subject: [PATCH] Update instance reference from property inspector. Fixes https://gitlab.com/kicad/code/kicad/-/issues/19932 (cherry picked from commit 56b8fec74b2fc05dcf18192c3764ba0307f25666) --- eeschema/schematic.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eeschema/schematic.cpp b/eeschema/schematic.cpp index 7c54bc933e..dad079ed09 100644 --- a/eeschema/schematic.cpp +++ b/eeschema/schematic.cpp @@ -74,6 +74,16 @@ SCHEMATIC::SCHEMATIC( PROJECT* aPrj ) : wxString newValue = aItem->Get( aProperty ); + if( field->GetId() == REFERENCE_FIELD ) + { + symbol->SetRef( &sheetPath, newValue ); + + // The user might want to change all the units to the new ref. Or they + // might not. Since we have no way of knowing, we default to the most + // concrete action (change only the selected reference). + return; + } + wxString ref = symbol->GetRef( &sheetPath ); int unit = symbol->GetUnit(); LIB_ID libId = symbol->GetLibId();