From 78e4787297d4f2983849bb6a0432fcfc7f77db7b Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 20 Jul 2016 14:11:14 -0400 Subject: [PATCH] Eeschema: more schematic part library plugin prep work. * Remove unused sort and make upper case options from PART_LIB::GetEntryNames() and PART_LIB::GetEntryTypePowerNames() since they were never used anywhere in the code. All comparisons are case sensitive and the array of names is always sorted. --- eeschema/class_library.cpp | 32 ++++++-------------------------- eeschema/class_library.h | 10 ++-------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index c959ddef6a..7af694295d 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -92,28 +92,18 @@ PART_LIB::~PART_LIB() } -void PART_LIB::GetEntryNames( wxArrayString& aNames, bool aSort, bool aMakeUpperCase ) +void PART_LIB::GetEntryNames( wxArrayString& aNames ) { for( LIB_ALIAS_MAP::iterator it = m_amap.begin(); it!=m_amap.end(); it++ ) { - if( aMakeUpperCase ) - { - wxString tmp = (*it).first; - tmp.MakeUpper(); - aNames.Add( tmp ); - } - else - { - aNames.Add( (*it).first ); - } + aNames.Add( (*it).first ); } - if( aSort ) - aNames.Sort(); + aNames.Sort(); } -void PART_LIB::GetEntryTypePowerNames( wxArrayString& aNames, bool aSort, bool aMakeUpperCase ) +void PART_LIB::GetEntryTypePowerNames( wxArrayString& aNames ) { for( LIB_ALIAS_MAP::iterator it = m_amap.begin(); it!=m_amap.end(); it++ ) { @@ -123,20 +113,10 @@ void PART_LIB::GetEntryTypePowerNames( wxArrayString& aNames, bool aSort, bool a if( !root || !root->IsPower() ) continue; - if( aMakeUpperCase ) - { - wxString tmp = (*it).first; - tmp.MakeUpper(); - aNames.Add( tmp ); - } - else - { - aNames.Add( (*it).first ); - } + aNames.Add( (*it).first ); } - if( aSort ) - aNames.Sort(); + aNames.Sort(); } diff --git a/eeschema/class_library.h b/eeschema/class_library.h index 6b1f73977c..d6ee919951 100644 --- a/eeschema/class_library.h +++ b/eeschema/class_library.h @@ -433,21 +433,15 @@ public: * Load a string array with the names of all the entries in this library. * * @param aNames - String array to place entry names into. - * @param aSort - Sort names if true. - * @param aMakeUpperCase - Force entry names to upper case. */ - void GetEntryNames( wxArrayString& aNames, bool aSort = true, - bool aMakeUpperCase = false ); + void GetEntryNames( wxArrayString& aNames ); /** * Load a string array with the names of entries of type POWER in this library. * * @param aNames - String array to place entry names into. - * @param aSort - Sort names if true. - * @param aMakeUpperCase - Force entry names to upper case. */ - void GetEntryTypePowerNames( wxArrayString& aNames, bool aSort = true, - bool aMakeUpperCase = false ); + void GetEntryTypePowerNames( wxArrayString& aNames ); /** * Checks \a aPart for name conflict in the library.