refinements

This commit is contained in:
Dick Hollenbeck 2014-06-11 00:57:26 -05:00
parent 1385e39d89
commit 21b70093b0
1 changed files with 14 additions and 2 deletions

View File

@ -269,10 +269,11 @@ void FOOTPRINT_EDIT_FRAME::retainLastFootprint()
if( module ) if( module )
{ {
pcb_io.Format( GetBoard()->m_Modules ); pcb_io.Format( module );
wxString pretty = FROM_UTF8( pcb_io.GetStringOutput( true ).c_str() ); wxString pretty = FROM_UTF8( pcb_io.GetStringOutput( true ).c_str() );
// save the footprint in the RSTRING facility.
Prj().SetRString( PROJECT::PCB_FOOTPRINT, pretty ); Prj().SetRString( PROJECT::PCB_FOOTPRINT, pretty );
} }
} }
@ -303,10 +304,21 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
} }
if( module ) if( module )
GetBoard()->Add( module ); // assumes BOARD is empty. {
// assumes BOARD is empty.
wxASSERT( GetBoard()->m_Modules == NULL );
// no idea, its monkey see monkey do. I would encapsulate this into
// a member function if its actually necessary.
module->SetParent( GetBoard() );
module->SetLink( 0 );
GetBoard()->Add( module );
}
} }
} }
const wxChar* FOOTPRINT_EDIT_FRAME::GetFootprintEditorFrameName() const wxChar* FOOTPRINT_EDIT_FRAME::GetFootprintEditorFrameName()
{ {
return FOOTPRINT_EDIT_FRAME_NAME; return FOOTPRINT_EDIT_FRAME_NAME;