Some code cleanup to follow kicad style better
This commit is contained in:
parent
6a02ee6c4b
commit
bd8980596f
|
@ -53,7 +53,7 @@ STRING_FORMATTER* CLIPBOARD_IO::GetFormatter()
|
|||
return &m_formatter;
|
||||
}
|
||||
|
||||
void CLIPBOARD_IO::setBoard(BOARD* aBoard)
|
||||
void CLIPBOARD_IO::setBoard( BOARD* aBoard )
|
||||
{
|
||||
m_board = aBoard;
|
||||
}
|
||||
|
@ -114,8 +114,8 @@ void CLIPBOARD_IO::SaveSelection( SELECTION& aSelected )
|
|||
// If it is only a module, clear the nets from the pads
|
||||
if( clone->Type() == PCB_PAD_T )
|
||||
{
|
||||
D_PAD* pad = static_cast<D_PAD*>(clone);
|
||||
pad->SetNetCode(0,0);
|
||||
D_PAD* pad = static_cast<D_PAD*>( clone );
|
||||
pad->SetNetCode( 0, 0 );
|
||||
}
|
||||
|
||||
module.Add( clone );
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
MODULE* parseMODULE( wxArrayString* aInitialComments )
|
||||
throw( IO_ERROR, PARSE_ERROR, FUTURE_FORMAT_ERROR ) override
|
||||
{
|
||||
MODULE* mod = PCB_PARSER::parseMODULE(aInitialComments);
|
||||
MODULE* mod = PCB_PARSER::parseMODULE( aInitialComments );
|
||||
|
||||
//TODO: figure out better way of handling paths
|
||||
mod->SetPath( wxT( "" ) );
|
||||
|
@ -74,8 +74,8 @@ public:
|
|||
CLIPBOARD_IO();
|
||||
~CLIPBOARD_IO();
|
||||
|
||||
void setBoard(BOARD* aBoard);
|
||||
void writeHeader(BOARD* aBoard);
|
||||
void setBoard( BOARD* aBoard );
|
||||
void writeHeader( BOARD* aBoard );
|
||||
STRING_FORMATTER* GetFormatter();
|
||||
|
||||
|
||||
|
|
|
@ -746,15 +746,7 @@ int PCBNEW_CONTROL::AppendBoardFromClipboard( const TOOL_EVENT& aEvent )
|
|||
// or a single module
|
||||
|
||||
PCB_BASE_FRAME* frame = getEditFrame<PCB_BASE_FRAME>();
|
||||
if(frame->IsType( FRAME_PCB) )
|
||||
{
|
||||
|
||||
}
|
||||
else if( frame->IsType( FRAME_PCB_MODULE_EDITOR ) )
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
if( !( frame->IsType( FRAME_PCB ) ) && !( frame->IsType( FRAME_PCB_MODULE_EDITOR ) ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@ -817,14 +809,14 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
|
|||
{
|
||||
|
||||
PCB_EDIT_FRAME* editFrame = dynamic_cast<PCB_EDIT_FRAME*>( m_frame );
|
||||
if(!editFrame)
|
||||
if( !editFrame )
|
||||
return 1;
|
||||
|
||||
// Mark existing tracks, in order to know what are the new tracks
|
||||
// Tracks are inserted, not appended, so mark existing tracks to be
|
||||
// able to select the new tracks only later
|
||||
BOARD* board = getModel<BOARD>();
|
||||
if(!board)
|
||||
if( !board )
|
||||
return 1;
|
||||
|
||||
for( TRACK* track = board->m_Track; track; track = track->Next() )
|
||||
|
@ -1025,9 +1017,10 @@ void PCBNEW_CONTROL::setTransitions()
|
|||
Go( &PCBNEW_CONTROL::ToBeDone, PCB_ACTIONS::toBeDone.MakeEvent() );
|
||||
|
||||
// Append control
|
||||
Go( &PCBNEW_CONTROL::AppendBoardFromFile,PCB_ACTIONS::appendBoard.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::AppendBoardFromClipboard
|
||||
,PCB_ACTIONS::appendClipboard.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::AppendBoardFromFile,
|
||||
PCB_ACTIONS::appendBoard.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::AppendBoardFromClipboard,
|
||||
PCB_ACTIONS::appendClipboard.MakeEvent() );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue