diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 7476da6570..ccb00bfc0d 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -265,6 +265,16 @@ wxString LIB_PART::SubReference( int aUnit, bool aAddSeparator ) } +const wxString& LIB_PART::GetName() const +{ + static wxString dummy; + + wxCHECK_MSG( m_aliases.size(), dummy, "no aliases defined for symbol" ); + + return m_aliases[0]->GetName(); +} + + void LIB_PART::SetName( const wxString& aName ) { m_libId.SetLibItemName( aName, false ); diff --git a/eeschema/class_libentry.h b/eeschema/class_libentry.h index 4e9de9201a..37215f6f7f 100644 --- a/eeschema/class_libentry.h +++ b/eeschema/class_libentry.h @@ -262,7 +262,7 @@ public: virtual void SetName( const wxString& aName ); - const wxString& GetName() const { return m_aliases[0]->GetName(); } + const wxString& GetName() const; const LIB_ID& GetLibId() const { return m_libId; }