Fix variable substitutions in library tables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16601
This commit is contained in:
parent
b7460f29b4
commit
4fac43d696
|
@ -114,12 +114,17 @@ protected:
|
||||||
public:
|
public:
|
||||||
void SetValue( int aRow, int aCol, const wxString &aValue ) override
|
void SetValue( int aRow, int aCol, const wxString &aValue ) override
|
||||||
{
|
{
|
||||||
|
wxCHECK( aRow < (int) size(), /* void */ );
|
||||||
|
|
||||||
LIB_TABLE_GRID::SetValue( aRow, aCol, aValue );
|
LIB_TABLE_GRID::SetValue( aRow, aCol, aValue );
|
||||||
|
|
||||||
// If setting a filepath, attempt to auto-detect the format
|
// If setting a filepath, attempt to auto-detect the format
|
||||||
if( aCol == COL_URI )
|
if( aCol == COL_URI )
|
||||||
{
|
{
|
||||||
SCH_IO_MGR::SCH_FILE_T pluginType = SCH_IO_MGR::GuessPluginTypeFromLibPath( aValue );
|
LIB_TABLE_ROW* row = at( (size_t) aRow );
|
||||||
|
wxString fullURI = row->GetFullURI( true );
|
||||||
|
|
||||||
|
SCH_IO_MGR::SCH_FILE_T pluginType = SCH_IO_MGR::GuessPluginTypeFromLibPath( fullURI );
|
||||||
|
|
||||||
if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
||||||
pluginType = SCH_IO_MGR::SCH_KICAD;
|
pluginType = SCH_IO_MGR::SCH_KICAD;
|
||||||
|
|
|
@ -188,12 +188,17 @@ public:
|
||||||
|
|
||||||
void SetValue( int aRow, int aCol, const wxString &aValue ) override
|
void SetValue( int aRow, int aCol, const wxString &aValue ) override
|
||||||
{
|
{
|
||||||
|
wxCHECK( aRow < (int) size(), /* void */ );
|
||||||
|
|
||||||
LIB_TABLE_GRID::SetValue( aRow, aCol, aValue );
|
LIB_TABLE_GRID::SetValue( aRow, aCol, aValue );
|
||||||
|
|
||||||
// If setting a filepath, attempt to auto-detect the format
|
// If setting a filepath, attempt to auto-detect the format
|
||||||
if( aCol == COL_URI )
|
if( aCol == COL_URI )
|
||||||
{
|
{
|
||||||
PCB_IO_MGR::PCB_FILE_T pluginType = PCB_IO_MGR::GuessPluginTypeFromLibPath( aValue );
|
LIB_TABLE_ROW* row = at( (size_t) aRow );
|
||||||
|
wxString fullURI = row->GetFullURI( true );
|
||||||
|
|
||||||
|
PCB_IO_MGR::PCB_FILE_T pluginType = PCB_IO_MGR::GuessPluginTypeFromLibPath( fullURI );
|
||||||
|
|
||||||
if( pluginType == PCB_IO_MGR::UNKNOWN )
|
if( pluginType == PCB_IO_MGR::UNKNOWN )
|
||||||
pluginType = PCB_IO_MGR::KICAD_SEXP;
|
pluginType = PCB_IO_MGR::KICAD_SEXP;
|
||||||
|
|
Loading…
Reference in New Issue