SCH_COMPONENT: Add `const` specifier to all constructor parameters

This commit is contained in:
Roberto Fernandez Bautista 2021-02-02 19:20:40 +00:00 committed by Wayne Stambaugh
parent 4dc264175a
commit 552bb5821f
2 changed files with 8 additions and 7 deletions

View File

@ -99,7 +99,8 @@ SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos, SCH_ITEM* aParent ) :
}
SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* sheet,
SCH_COMPONENT::SCH_COMPONENT( const LIB_PART& aPart, const LIB_ID& aLibId,
const SCH_SHEET_PATH* aSheet,
int unit, int convert, const wxPoint& pos ) :
SCH_ITEM( NULL, SCH_COMPONENT_T )
{
@ -119,8 +120,8 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* sh
UpdateFields( true, true );
// Update the reference -- just the prefix for now.
if( sheet )
SetRef( sheet, m_part->GetReferenceField().GetText() + wxT( "?" ) );
if( aSheet )
SetRef( aSheet, m_part->GetReferenceField().GetText() + wxT( "?" ) );
else
m_prefix = m_part->GetReferenceField().GetText() + wxT( "?" );
@ -130,8 +131,8 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* sh
}
SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* aSheet, PICKED_SYMBOL& aSel,
const wxPoint& pos ) :
SCH_COMPONENT::SCH_COMPONENT( const LIB_PART& aPart, const SCH_SHEET_PATH* aSheet,
const PICKED_SYMBOL& aSel, const wxPoint& pos ) :
SCH_COMPONENT( aPart, aSel.LibId, aSheet, aSel.Unit, aSel.Convert, pos )
{
// Set any fields that were modified as part of the component selection

View File

@ -133,11 +133,11 @@ public:
* @param pos - Position to place new component.
* @param setNewItemFlag - Set the component IS_NEW and IS_MOVED flags.
*/
SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* aSheet,
SCH_COMPONENT( const LIB_PART& aPart, const LIB_ID& aLibId, const SCH_SHEET_PATH* aSheet,
int unit = 0, int convert = 0,
const wxPoint& pos = wxPoint( 0, 0 ) );
SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* aSheet, PICKED_SYMBOL& aSel,
SCH_COMPONENT( const LIB_PART& aPart, const SCH_SHEET_PATH* aSheet, const PICKED_SYMBOL& aSel,
const wxPoint& pos = wxPoint( 0, 0 ) );
/**
* Clones \a aComponent into a new schematic symbol object.