From 2c20a10242bc4e6691db5eec634831e68e2fe5a0 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sun, 12 Nov 2017 23:47:27 +0100 Subject: [PATCH] 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. --- eeschema/class_libentry.h | 6 ------ eeschema/lib_manager.cpp | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/eeschema/class_libentry.h b/eeschema/class_libentry.h index 08e3546704..a5095c2630 100644 --- a/eeschema/class_libentry.h +++ b/eeschema/class_libentry.h @@ -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 diff --git a/eeschema/lib_manager.cpp b/eeschema/lib_manager.cpp index 8beb642129..170ad695ce 100644 --- a/eeschema/lib_manager.cpp +++ b/eeschema/lib_manager.cpp @@ -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;