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:
Wayne Stambaugh
2012-01-09 15:26:55 -05:00
parent e0dd754995
commit 81a7af5704
45 changed files with 205 additions and 198 deletions
+21
View File
@@ -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