Simplify and regularize text variable substitution architecture.

EDA_ITEMs are responsible for giving their parent a crack at it if
they failed to resolve it.  This recurses all the way up to the schematic/
board, and then to the project.

Cross-reference handling is also move to the EDA_ITEMs.  It must be done
before bubbling up so that we don't end up in loops.  (The aDepth parameter
will break the loop, but without having done anything useful.)

Fixes https://gitlab.com/kicad/code/kicad/issues/13541
This commit is contained in:
Jeff Young
2023-01-17 17:05:41 +00:00
parent 9820062c71
commit 26c821962f
23 changed files with 145 additions and 258 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -447,7 +447,7 @@ bool PLOT_CONTROLLER::OpenPlotfile( const wxString& aSuffix, PLOT_FORMAT aFormat
};
wxString outputDirName = GetPlotOptions().GetOutputDirectory();
outputDirName = ExpandTextVars( outputDirName, &textResolver, nullptr, nullptr );
outputDirName = ExpandTextVars( outputDirName, &textResolver );
outputDirName = ExpandEnvVarSubstitutions( outputDirName, nullptr );
wxFileName outputDir = wxFileName::DirName( outputDirName );