Commit 335f5a57 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

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

parent 4121c272
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -118,10 +118,8 @@ private:


    void OnPopupMenu( wxCommandEvent& event );
    void OnPopupMenu( wxCommandEvent& event );



    DRC*                m_tester;
    DRC*                m_tester;
    PCB_EDIT_FRAME*     m_Parent;
    PCB_EDIT_FRAME*     m_Parent;
    int                 m_UnconnectedCount;
};
};


#endif  // _DIALOG_DRC_H_
#endif  // _DIALOG_DRC_H_
+0 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,6 @@
class DIALOG_FOOTPRINT_WIZARD_LIST: public DIALOG_FOOTPRINT_WIZARD_LIST_BASE
class DIALOG_FOOTPRINT_WIZARD_LIST: public DIALOG_FOOTPRINT_WIZARD_LIST_BASE
{
{
private:
private:
    wxDialog * m_Parent;
    FOOTPRINT_WIZARD *m_FootprintWizard;
    FOOTPRINT_WIZARD *m_FootprintWizard;


public:
public:
+13 −2
Original line number Original line Diff line number Diff line
@@ -483,7 +483,8 @@ void LEGACY_PLUGIN::loadGENERAL()
            m_board->SetBoundingBox( bbbox );
            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" ) )
        else if( TESTLINE( "Ndraw" ) )
        {
        {
            NbDraw = intParse( line + SZ( "Ndraw" ) );
            NbDraw = intParse( line + SZ( "Ndraw" ) );
@@ -509,6 +510,11 @@ void LEGACY_PLUGIN::loadGENERAL()
            m_netCodes.resize( intParse( line + SZ( "Nnets" ) ) );
            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" ) )
        else if( TESTLINE( "$EndGENERAL" ) )
            return;     // preferred exit
            return;     // preferred exit
    }
    }
@@ -1823,7 +1829,7 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM()


    NETINFO_ITEM*   net = NULL;
    NETINFO_ITEM*   net = NULL;
    char*           line;
    char*           line;
    int             netCode;
    int             netCode = 0;


    while( ( line = READLINE( m_reader ) ) != NULL )
    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 ) )
            if( net != NULL && ( net->GetNet() > 0 || m_board->FindNet( 0 ) == NULL ) )
            {
            {
                m_board->AppendNet( net );
                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();
                m_netCodes[netCode] = net->GetNet();
            }
            }
            else
            else
+0 −1
Original line number Original line Diff line number Diff line
@@ -252,7 +252,6 @@ class SELECT_COPPER_LAYERS_PAIR_DIALOG: public PCB_LAYER_SELECTOR,
                                        public DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE
                                        public DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE
{
{
private:
private:
    BOARD* m_brd;
    LAYER_NUM m_frontLayer;
    LAYER_NUM m_frontLayer;
    LAYER_NUM m_backLayer;
    LAYER_NUM m_backLayer;
    int m_leftRowSelected;
    int m_leftRowSelected;