When updating RefDes only update the prefix.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16991
This commit is contained in:
Jeff Young 2024-02-18 21:43:27 +00:00
parent 25291d6e3a
commit b6036f368e
1 changed files with 11 additions and 2 deletions

View File

@ -650,10 +650,19 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( SCH_COMMIT* aCommit,
{
if( i == REFERENCE_FIELD )
{
wxString prefix = UTIL::GetRefDesPrefix( libField->GetText() );
for( const SCH_SHEET_PATH& instance : symbol_change_info.m_Instances )
{
symbol->SetRef( &instance,
UTIL::GetRefDesUnannotated( libField->GetText() ) );
wxString ref = symbol->GetRef( &instance, true );
int number = UTIL::GetRefDesNumber( ref );
if( number >= 0 )
ref.Printf( wxS( "%s%d" ), prefix, number );
else
ref = UTIL::GetRefDesUnannotated( prefix );
symbol->SetRef( &instance, ref );
}
}
else if( i == VALUE_FIELD )