Removed LIB_PART::SetLibId()

To avoid potential incoherency, LIB_ID is defined by setting the part
name and library.
This commit is contained in:
Maciej Suminski 2017-11-12 22:41:08 +01:00
parent 445ac50588
commit aa81f5b98d
4 changed files with 0 additions and 13 deletions

View File

@ -314,14 +314,6 @@ void LIB_PART::SetName( const wxString& aName )
}
void LIB_PART::SetLibId( const LIB_ID& aLibId )
{
m_libId.SetLibNickname( aLibId.GetLibNickname() );
// SetName() sets LibItemName in m_libId
SetName( aLibId.GetLibItemName() );
}
void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset,
int aMulti, int aConvert, const PART_DRAW_OPTIONS& aOpts )
{

View File

@ -282,7 +282,6 @@ public:
const wxString& GetName() const { return m_aliases[0]->GetName(); }
const LIB_ID& GetLibId() const { return m_libId; }
void SetLibId( const LIB_ID& aLibId );
const wxString GetLibraryName();

View File

@ -409,7 +409,6 @@ wxString RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::GetActionDescription() const
bool RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction( RESCUER* aRescuer )
{
LIB_PART new_part( *m_cache_candidate );
new_part.SetLibId( m_new_id );
new_part.SetName( m_new_id.GetLibItemName() );
new_part.RemoveAllAliases();
aRescuer->AddPart( &new_part );

View File

@ -2492,9 +2492,6 @@ LIB_PART* SCH_LEGACY_PLUGIN_CACHE::loadPart( FILE_LINE_READER& aReader )
part->GetValueField().SetVisible( false );
}
// Don't set the library alias, this is determined by the symbol library table.
part->SetLibId( LIB_ID( wxEmptyString, part->GetName() ) );
// There are some code paths in SetText() that do not set the root alias to the
// alias list so add it here if it didn't get added by SetText().
if( !part->HasAlias( part->GetName() ) )