Expand text vars in titleblock before exporting.

Fixes https://gitlab.com/kicad/code/kicad/issues/10197
This commit is contained in:
Jeff Young 2022-01-22 15:54:10 +00:00
parent a187076438
commit 407660201e
2 changed files with 4 additions and 4 deletions

View File

@ -987,9 +987,9 @@ static bool CreateHeaderInfoData( FILE* aFile, PCB_EDIT_FRAME* aFrame )
msg = wxT( "DRAWING \"" ) + board->GetFileName() + wxT( "\"\n" );
fputs( TO_UTF8( msg ), aFile );
const TITLE_BLOCK& tb = aFrame->GetTitleBlock();
msg = wxT( "REVISION \"" ) + tb.GetRevision() + wxT( " " ) + tb.GetDate() + wxT( "\"\n" );
wxString rev = ExpandTextVars( board->GetTitleBlock().GetRevision(), board->GetProject() );
wxString date = ExpandTextVars( board->GetTitleBlock().GetDate(), board->GetProject() );
msg = wxT( "REVISION \"" ) + rev + wxT( " " ) + date + wxT( "\"\n" );
fputs( TO_UTF8( msg ), aFile );
fputs( "UNITS INCH\n", aFile );

View File

@ -258,7 +258,7 @@ void GERBER_JOBFILE_WRITER::addJSONGeneralSpecs()
msg = fn.GetName();
// build the <rec> string. All non ASCII chars and comma are replaced by '_'
wxString rev = m_pcb->GetTitleBlock().GetRevision();
wxString rev = ExpandTextVars( m_pcb->GetTitleBlock().GetRevision(), m_pcb->GetProject() );
if( rev.IsEmpty() )
rev = wxT( "rev?" );