libedit: Don't move the field below the last item

There needs to be at least one item below the one we want to move down
in order to allow the action.

Fixes: lp:1820532
* https://bugs.launchpad.net/kicad/+bug/1820532

(cherry picked from commit 0943c176a3)
This commit is contained in:
Seth Hillbrand 2019-03-17 20:19:21 -07:00
parent e999636048
commit 4facd57cb7
1 changed files with 1 additions and 1 deletions

View File

@ -490,7 +490,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown( wxCommandEvent& event )
int i = m_grid->GetGridCursorRow();
if( i >= MANDATORY_FIELDS )
if( i >= MANDATORY_FIELDS && i + 1 < m_fields->GetNumberRows() )
{
LIB_FIELD tmp = m_fields->at( (unsigned) i );
m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );