Give SCH_TABLEs uuids.

(Otherwise they can't participate in SCH_GROUPs.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20760
This commit is contained in:
Jeff Young 2025-04-25 21:58:00 +01:00
parent b2f3a2f8ba
commit 99b0a3e656
3 changed files with 13 additions and 6 deletions

View File

@ -120,4 +120,5 @@
//#define SEXPR_SCHEMATIC_FILE_VERSION 20250114 // Full paths for text variable cross references
//#define SEXPR_SCHEMATIC_FILE_VERSION 20250222 // Hatched fills for shapes
//#define SEXPR_SCHEMATIC_FILE_VERSION 20250227 // Support for local power symbols
#define SEXPR_SCHEMATIC_FILE_VERSION 20250318 // ~ no longer means empty text
//#define SEXPR_SCHEMATIC_FILE_VERSION 20250318 // ~ no longer means empty text
#define SEXPR_SCHEMATIC_FILE_VERSION 20250425 // uuids for tables

View File

@ -1436,8 +1436,7 @@ void SCH_IO_KICAD_SEXPR::saveTable( SCH_TABLE* aTable )
for( int col = 0; col < aTable->GetColCount(); ++col )
{
m_out->Print( " %s",
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale,
aTable->GetColWidth( col ) ).c_str() );
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTable->GetColWidth( col ) ).c_str() );
}
m_out->Print( ")" );
@ -1447,12 +1446,13 @@ void SCH_IO_KICAD_SEXPR::saveTable( SCH_TABLE* aTable )
for( int row = 0; row < aTable->GetRowCount(); ++row )
{
m_out->Print( " %s",
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale,
aTable->GetRowHeight( row ) ).c_str() );
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTable->GetRowHeight( row ) ).c_str() );
}
m_out->Print( ")" );
KICAD_FORMAT::FormatUuid( m_out, aTable->m_Uuid );
m_out->Print( "(cells" );
for( SCH_TABLECELL* cell : aTable->GetCells() )

View File

@ -4748,8 +4748,14 @@ SCH_TABLE* SCH_IO_KICAD_SEXPR_PARSER::parseSchTable()
break;
case T_uuid:
NeedSYMBOL();
const_cast<KIID&>( table->m_Uuid ) = parseKIID();
NeedRIGHT();
break;
default:
Expecting( "columns, col_widths, row_heights, border, separators, header or cells" );
Expecting( "columns, col_widths, row_heights, border, separators, uuid, header or cells" );
}
}