Honour m_resolveTextVars flag for properties as well as fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/11937
(cherry picked from commit 5479514819
)
This commit is contained in:
parent
e06e65cdde
commit
6e10a496ef
|
@ -317,16 +317,24 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
|||
|
||||
for( size_t jj = MANDATORY_FIELDS; jj < fields.size(); ++jj )
|
||||
{
|
||||
xcomp->AddChild( xproperty = node( "property" ) );
|
||||
xproperty->AddAttribute( "name", fields[jj].GetCanonicalName() );
|
||||
xproperty->AddAttribute( "value", fields[jj].GetText() );
|
||||
xcomp->AddChild( xproperty = node( wxT( "property" ) ) );
|
||||
xproperty->AddAttribute( wxT( "name" ), fields[jj].GetCanonicalName() );
|
||||
|
||||
if( m_resolveTextVars )
|
||||
xproperty->AddAttribute( wxT( "value" ), fields[jj].GetShownText() );
|
||||
else
|
||||
xproperty->AddAttribute( wxT( "value" ), fields[jj].GetText() );
|
||||
}
|
||||
|
||||
for( const SCH_FIELD& sheetField : sheet.Last()->GetFields() )
|
||||
{
|
||||
xcomp->AddChild( xproperty = node( "property" ) );
|
||||
xproperty->AddAttribute( "name", sheetField.GetCanonicalName() );
|
||||
xproperty->AddAttribute( "value", sheetField.GetText() );
|
||||
xcomp->AddChild( xproperty = node( wxT( "property" ) ) );
|
||||
xproperty->AddAttribute( wxT( "name" ), sheetField.GetCanonicalName() );
|
||||
|
||||
if( m_resolveTextVars )
|
||||
xproperty->AddAttribute( wxT( "value" ), sheetField.GetShownText() );
|
||||
else
|
||||
xproperty->AddAttribute( wxT( "value" ), sheetField.GetText() );
|
||||
}
|
||||
|
||||
if( !symbol->GetIncludeInBom() )
|
||||
|
@ -351,11 +359,12 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
|||
xcomp->AddChild( xunits = node( "tstamps" ) );
|
||||
|
||||
auto range = extra_units.equal_range( symbol );
|
||||
wxString uuid;
|
||||
|
||||
// Output a series of children with all UUIDs associated with the REFDES
|
||||
for( auto it = range.first; it != range.second; ++it )
|
||||
{
|
||||
wxString uuid = ( *it )->m_Uuid.AsString();
|
||||
uuid = ( *it )->m_Uuid.AsString();
|
||||
|
||||
// Add a space between UUIDs, if not in KICAD mode (i.e.
|
||||
// using wxXmlDocument::Save()). KICAD MODE has its own XNODE::Format function.
|
||||
|
@ -366,8 +375,8 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
|||
}
|
||||
|
||||
// Output the primary UUID
|
||||
xunits->AddChild(
|
||||
new XNODE( wxXML_TEXT_NODE, wxEmptyString, symbol->m_Uuid.AsString() ) );
|
||||
uuid = symbol->m_Uuid.AsString();
|
||||
xunits->AddChild( new XNODE( wxXML_TEXT_NODE, wxEmptyString, uuid ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue