Eeschema schematic object improvements.
* Remove unnecessary copy constructors from schematic and component library objects. * Add comment to class definitions where the default copy constructor generated by the compiler was adequate. * Add assignment operator to EDA_ITEM, SCH_ITEM, and all schematic objects where the default assignment operator generated by the compiler would not be adequate.
This commit is contained in:
@@ -212,6 +212,27 @@ bool EDA_ITEM::operator<( const EDA_ITEM& aItem ) const
|
||||
}
|
||||
|
||||
|
||||
EDA_ITEM& EDA_ITEM::operator=( const EDA_ITEM& aItem )
|
||||
{
|
||||
wxCHECK_MSG( Type() == aItem.Type(), *this,
|
||||
wxT( "Cannot assign object type " ) + aItem.GetClass() + wxT( " to type " ) +
|
||||
GetClass() );
|
||||
|
||||
if( &aItem != this )
|
||||
{
|
||||
// Do not assign the linked list pointers.
|
||||
m_StructType = aItem.m_StructType;
|
||||
m_Parent = aItem.m_Parent;
|
||||
m_Son = aItem.m_Son;
|
||||
m_Flags = aItem.m_Flags;
|
||||
SetTimeStamp( aItem.m_TimeStamp );
|
||||
m_Status = aItem.m_Status;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
||||
// A function that should have been in wxWidgets
|
||||
|
||||
Reference in New Issue
Block a user