Commit 21b70093 authored by Dick Hollenbeck's avatar Dick Hollenbeck

refinements

parent 1385e39d
...@@ -269,10 +269,11 @@ void FOOTPRINT_EDIT_FRAME::retainLastFootprint() ...@@ -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() ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment