Don't allow panel to overwrite values set in Spice Model editor.

Fixes: lp:1766920
* https://bugs.launchpad.net/kicad/+bug/1766920
This commit is contained in:
Jeff Young 2018-04-26 19:12:14 +01:00
parent 6ccc8577ad
commit 5e5e80d392
2 changed files with 9 additions and 2 deletions

View File

@ -351,7 +351,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::EditSpiceModel( wxCommandEvent& event )
if( dialog.ShowModal() != wxID_OK )
return;
// Transfert sch fields to the m_FieldsBuf fields buffer dialog:
// Transfer sch fields to the m_FieldsBuf fields buffer dialog:
m_FieldsBuf.clear();
for( unsigned ii = 0; ii < schfields.size(); ii++ )
@ -361,6 +361,9 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::EditSpiceModel( wxCommandEvent& event )
m_FieldsBuf.push_back( libfield );
}
// ... and to the panel:
copySelectedFieldToPanel();
updateDisplay();
#endif /* KICAD_SPICE */
}

View File

@ -1031,7 +1031,11 @@ LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number )
void SCH_COMPONENT::GetPins( std::vector<LIB_PIN*>& aPinsList )
{
if( PART_SPTR part = m_part.lock() )
if( m_part.expired() )
{
// no pins; nothing to get
}
else if( PART_SPTR part = m_part.lock() )
{
part->GetPins( aPinsList, m_unit, m_convert );
}