diff --git a/common/eda_item.cpp b/common/eda_item.cpp index 5135ff2f4e..b0705992d7 100644 --- a/common/eda_item.cpp +++ b/common/eda_item.cpp @@ -88,6 +88,14 @@ EDA_ITEM* EDA_ITEM::findParent( KICAD_T aType ) const } +void EDA_ITEM::SetParent( EDA_ITEM* aParent ) +{ + wxCHECK( aParent != this, /* void */ ); + + m_parent = aParent; +} + + KIID EDA_ITEM::GetParentGroupId() const { if( EDA_GROUP* group = GetParentGroup() ) diff --git a/include/eda_item.h b/include/eda_item.h index e83bac2bed..1d9eb5c820 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -110,7 +110,7 @@ public: inline KICAD_T Type() const { return m_structType; } EDA_ITEM* GetParent() const { return m_parent; } - virtual void SetParent( EDA_ITEM* aParent ) { m_parent = aParent; } + virtual void SetParent( EDA_ITEM* aParent ); virtual void SetParentGroup( EDA_GROUP* aGroup ) { m_group = aGroup; } virtual EDA_GROUP* GetParentGroup() const { return m_group; }