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
This commit is contained in:
parent
d6f565e452
commit
0943c176a3
|
@ -480,7 +480,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown( wxCommandEvent& event )
|
||||||
|
|
||||||
int i = m_grid->GetGridCursorRow();
|
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 );
|
LIB_FIELD tmp = m_fields->at( (unsigned) i );
|
||||||
m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );
|
m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );
|
||||||
|
|
Loading…
Reference in New Issue