Only convert references to KIIDs if the variable resolves.

Fixes https://gitlab.com/kicad/code/kicad/issues/2458
This commit is contained in:
Jeff Young 2020-04-11 20:37:06 +01:00
parent dbded3e5dc
commit 350696ecdd
2 changed files with 10 additions and 2 deletions

View File

@ -271,7 +271,11 @@ wxString convertReferencesToKIIDs( const wxString& aSource )
if( ref == refComponent->GetRef( &references[ jj ].GetSheetPath(), true ) ) if( ref == refComponent->GetRef( &references[ jj ].GetSheetPath(), true ) )
{ {
token = refComponent->m_Uuid.AsString() + ":" + remainder; wxString test( remainder );
if( refComponent->ResolveTextVar( &test ) )
token = refComponent->m_Uuid.AsString() + ":" + remainder;
break; break;
} }
} }

View File

@ -368,7 +368,11 @@ wxString DIALOG_TEXT_PROPERTIES::convertReferencesToKIIDs( const wxString& aSour
{ {
if( mod->GetReference().CmpNoCase( ref ) == 0 ) if( mod->GetReference().CmpNoCase( ref ) == 0 )
{ {
token = mod->m_Uuid.AsString() + ":" + remainder; wxString test( remainder );
if( mod->ResolveTextVar( &test ) )
token = mod->m_Uuid.AsString() + ":" + remainder;
break; break;
} }
} }