Resolve text variables in title blocks for outputing to netlist.

Fixes https://gitlab.com/kicad/code/kicad/issues/7153
This commit is contained in:
Jeff Young
2021-01-17 16:24:22 +00:00
parent 1754504234
commit f1221a9ca3
10 changed files with 40 additions and 33 deletions
+3 -4
View File
@@ -276,8 +276,7 @@ static wxString& makeStringCompatX1( wxString& aText, bool aUseX1CompatibilityMo
}
void AddGerberX2Header( PLOTTER * aPlotter,
const BOARD *aBoard, bool aUseX1CompatibilityMode )
void AddGerberX2Header( PLOTTER * aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode )
{
wxString text;
@@ -312,8 +311,8 @@ void AddGerberX2Header( PLOTTER * aPlotter,
msg = fn.GetName();
msg.Replace( wxT( "," ), wxT( "_" ) );
// build the <rec> string. All non ASCII chars and comma are replaced by '_'
wxString rev = ((BOARD*)aBoard)->GetTitleBlock().GetRevision();
// build the <revision id> string. All non ASCII chars and comma are replaced by '_'
wxString rev = ExpandTextVars( aBoard->GetTitleBlock().GetRevision(), aBoard->GetProject() );
rev.Replace( wxT( "," ), wxT( "_" ) );
if( rev.IsEmpty() )