Use correct sheetpath when exporting netlist.

(cherry picked from commit c20ef06f56)
This commit is contained in:
Jeff Young 2023-05-04 14:27:04 +01:00
parent 7cc014cf9e
commit d20147c79f
1 changed files with 6 additions and 6 deletions

View File

@ -138,7 +138,7 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
footprint = candidate;
candidate = m_resolveTextVars
? symbol2->GetField( DATASHEET_FIELD )->GetShownText( 0, false )
? symbol2->GetField( DATASHEET_FIELD )->GetShownText( aSheet, 0, false )
: symbol2->GetField( DATASHEET_FIELD )->GetText();
if( !candidate.IsEmpty() && ( unit < minUnit || datasheet.IsEmpty() ) )
@ -152,7 +152,7 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
&& ( unit < minUnit || userFields.count( f.GetName() ) == 0 ) )
{
if( m_resolveTextVars )
userFields[ f.GetName() ] = f.GetShownText( 0, false );
userFields[ f.GetName() ] = f.GetShownText( aSheet, 0, false );
else
userFields[ f.GetName() ] = f.GetText();
}
@ -168,7 +168,7 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
footprint = aSymbol->GetFootprintFieldText( m_resolveTextVars );
if( m_resolveTextVars )
datasheet = aSymbol->GetField( DATASHEET_FIELD )->GetShownText( 0, false );
datasheet = aSymbol->GetField( DATASHEET_FIELD )->GetShownText( aSheet, 0, false );
else
datasheet = aSymbol->GetField( DATASHEET_FIELD )->GetText();
@ -179,7 +179,7 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
if( f.GetText().size() )
{
if( m_resolveTextVars )
userFields[ f.GetName() ] = f.GetShownText( 0, false );
userFields[ f.GetName() ] = f.GetShownText( aSheet, 0, false );
else
userFields[ f.GetName() ] = f.GetText();
}
@ -321,7 +321,7 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
xproperty->AddAttribute( wxT( "name" ), fields[jj].GetCanonicalName() );
if( m_resolveTextVars )
xproperty->AddAttribute( wxT( "value" ), fields[jj].GetShownText( 0, false ) );
xproperty->AddAttribute( wxT( "value" ), fields[jj].GetShownText( &sheet, 0, false ) );
else
xproperty->AddAttribute( wxT( "value" ), fields[jj].GetText() );
}
@ -334,7 +334,7 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
if( m_resolveTextVars )
// do not allow GetShownText() to add any prefix useful only when displaying
// the field on screen
xproperty->AddAttribute( wxT( "value" ), sheetField.GetShownText( 0, false ) );
xproperty->AddAttribute( wxT( "value" ), sheetField.GetShownText( &sheet, 0, false ) );
else
xproperty->AddAttribute( wxT( "value" ), sheetField.GetText() );
}