Pcbnew: fix an issue with very old .brd files.

This commit is contained in:
jean-pierre charras 2014-06-06 12:30:07 +02:00
parent 4121c27269
commit 335f5a57e5
4 changed files with 13 additions and 6 deletions

View File

@ -118,10 +118,8 @@ private:
void OnPopupMenu( wxCommandEvent& event );
DRC* m_tester;
PCB_EDIT_FRAME* m_Parent;
int m_UnconnectedCount;
};
#endif // _DIALOG_DRC_H_

View File

@ -11,7 +11,6 @@
class DIALOG_FOOTPRINT_WIZARD_LIST: public DIALOG_FOOTPRINT_WIZARD_LIST_BASE
{
private:
wxDialog * m_Parent;
FOOTPRINT_WIZARD *m_FootprintWizard;
public:

View File

@ -483,7 +483,8 @@ void LEGACY_PLUGIN::loadGENERAL()
m_board->SetBoundingBox( bbbox );
}
/* Read the number of segments of type DRAW, TRACK, ZONE
/* This is no more usefull, so this info is no more parsed
// Read the number of segments of type DRAW, TRACK, ZONE
else if( TESTLINE( "Ndraw" ) )
{
NbDraw = intParse( line + SZ( "Ndraw" ) );
@ -509,6 +510,11 @@ void LEGACY_PLUGIN::loadGENERAL()
m_netCodes.resize( intParse( line + SZ( "Nnets" ) ) );
}
else if( TESTLINE( "Nn" ) ) // id "Nnets" for old .brd files
{
m_netCodes.resize( intParse( line + SZ( "Nn" ) ) );
}
else if( TESTLINE( "$EndGENERAL" ) )
return; // preferred exit
}
@ -1823,7 +1829,7 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM()
NETINFO_ITEM* net = NULL;
char* line;
int netCode;
int netCode = 0;
while( ( line = READLINE( m_reader ) ) != NULL )
{
@ -1846,6 +1852,11 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM()
if( net != NULL && ( net->GetNet() > 0 || m_board->FindNet( 0 ) == NULL ) )
{
m_board->AppendNet( net );
// Be sure we have room to store the net in m_netCodes
if( (int)m_netCodes.size() <= netCode )
m_netCodes.resize( netCode+1 );
m_netCodes[netCode] = net->GetNet();
}
else

View File

@ -252,7 +252,6 @@ class SELECT_COPPER_LAYERS_PAIR_DIALOG: public PCB_LAYER_SELECTOR,
public DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE
{
private:
BOARD* m_brd;
LAYER_NUM m_frontLayer;
LAYER_NUM m_backLayer;
int m_leftRowSelected;