Removed friendship in LIB_PART and LIB_ALIAS classes.

It is not required and may a source of unnecessary temptation. There is
no place for friendship in rough C++ world.
This commit is contained in:
Maciej Suminski 2017-11-12 23:47:27 +01:00
parent aa81f5b98d
commit 2c20a10242
2 changed files with 2 additions and 8 deletions

View File

@ -89,8 +89,6 @@ class LIB_ALIAS : public EDA_ITEM
*/
LIB_PART* shared;
friend class LIB_PART;
protected:
wxString name;
wxString description; ///< documentation for info
@ -226,10 +224,6 @@ struct PART_DRAW_OPTIONS
*/
class LIB_PART : public EDA_ITEM
{
friend class PART_LIB;
friend class LIB_ALIAS;
friend class SCH_LEGACY_PLUGIN_CACHE;
PART_SPTR m_me; ///< http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared
LIB_ID m_libId;
int m_pinNameOffset; ///< The offset in mils to draw the pin name. Set to 0

View File

@ -555,9 +555,9 @@ bool LIB_MANAGER::LIB_BUFFER::CreateBuffer( LIB_PART* aCopy, SCH_SCREEN* aScreen
// Set the parent library name,
// otherwise it is empty as no library has been given as the owner during object construction
LIB_ID libId = aCopy->GetLibId();
// TODO create a class derived from
LIB_ID& libId = (LIB_ID&) aCopy->GetLibId();
libId.SetLibNickname( m_libName );
aCopy->SetLibId( libId );
++m_hash;
return true;