Loading pcbnew/dialogs/dialog_fp_lib_table.cpp +9 −4 Original line number Original line Diff line number Diff line Loading @@ -166,7 +166,9 @@ public: bool DeleteRows( size_t aPos, size_t aNumRows ) bool DeleteRows( size_t aPos, size_t aNumRows ) { { if( aPos + aNumRows <= rows.size() ) // aPos may be a large positive, e.g. size_t(-1), and the sum of // aPos+aNumRows may wrap here, so both ends of the range are tested. if( aPos < rows.size() && aPos + aNumRows <= rows.size() ) { { ROWS_ITER start = rows.begin() + aPos; ROWS_ITER start = rows.begin() + aPos; rows.erase( start, start + aNumRows ); rows.erase( start, start + aNumRows ); Loading Loading @@ -512,11 +514,14 @@ private: int rowCount = m_cur_grid->GetNumberRows(); int rowCount = m_cur_grid->GetNumberRows(); int curRow = getCursorRow(); int curRow = getCursorRow(); if( curRow >= 0 ) { m_cur_grid->DeleteRows( curRow ); m_cur_grid->DeleteRows( curRow ); if( curRow && curRow == rowCount - 1 ) if( curRow && curRow == rowCount - 1 ) m_cur_grid->SetGridCursor( curRow-1, getCursorCol() ); m_cur_grid->SetGridCursor( curRow-1, getCursorCol() ); } } } void moveUpHandler( wxMouseEvent& event ) void moveUpHandler( wxMouseEvent& event ) { { Loading Loading
pcbnew/dialogs/dialog_fp_lib_table.cpp +9 −4 Original line number Original line Diff line number Diff line Loading @@ -166,7 +166,9 @@ public: bool DeleteRows( size_t aPos, size_t aNumRows ) bool DeleteRows( size_t aPos, size_t aNumRows ) { { if( aPos + aNumRows <= rows.size() ) // aPos may be a large positive, e.g. size_t(-1), and the sum of // aPos+aNumRows may wrap here, so both ends of the range are tested. if( aPos < rows.size() && aPos + aNumRows <= rows.size() ) { { ROWS_ITER start = rows.begin() + aPos; ROWS_ITER start = rows.begin() + aPos; rows.erase( start, start + aNumRows ); rows.erase( start, start + aNumRows ); Loading Loading @@ -512,11 +514,14 @@ private: int rowCount = m_cur_grid->GetNumberRows(); int rowCount = m_cur_grid->GetNumberRows(); int curRow = getCursorRow(); int curRow = getCursorRow(); if( curRow >= 0 ) { m_cur_grid->DeleteRows( curRow ); m_cur_grid->DeleteRows( curRow ); if( curRow && curRow == rowCount - 1 ) if( curRow && curRow == rowCount - 1 ) m_cur_grid->SetGridCursor( curRow-1, getCursorCol() ); m_cur_grid->SetGridCursor( curRow-1, getCursorCol() ); } } } void moveUpHandler( wxMouseEvent& event ) void moveUpHandler( wxMouseEvent& event ) { { Loading