From 5e5e80d392d18d9b40ea13137c6c68bfaeba2da2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 26 Apr 2018 19:12:14 +0100 Subject: [PATCH] Don't allow panel to overwrite values set in Spice Model editor. Fixes: lp:1766920 * https://bugs.launchpad.net/kicad/+bug/1766920 --- eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp | 5 ++++- eeschema/sch_component.cpp | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp index ea70ab6d4d..346ee14007 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp @@ -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 */ } diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 4dc29ea6db..fc261ea8a8 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1031,7 +1031,11 @@ LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number ) void SCH_COMPONENT::GetPins( std::vector& 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 ); }