Resolve text variables before attempting to open datasheet.
(cherry picked from commit 510dc28a5c
)
This commit is contained in:
parent
b041a77cfa
commit
da82ba00e4
|
@ -517,13 +517,18 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent )
|
|||
|
||||
SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front();
|
||||
|
||||
datasheet = symbol->GetField( DATASHEET_FIELD )->GetText();
|
||||
// Use GetShownText() to resolve any text variables
|
||||
datasheet = symbol->GetField( DATASHEET_FIELD )->GetShownText();
|
||||
}
|
||||
|
||||
if( datasheet.IsEmpty() || datasheet == wxT( "~" ) )
|
||||
{
|
||||
m_frame->ShowInfoBarError( _( "No datasheet defined." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
GetAssociatedDocument( m_frame, datasheet, &m_frame->Prj() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue