Fix undo of pin edit.

Undo stashing must happen before modifications.

Fixes: lp:1750401
* https://bugs.launchpad.net/kicad/+bug/1750401
This commit is contained in:
Jeff Young 2018-02-19 18:13:10 +00:00 committed by Wayne Stambaugh
parent 0e493a3f91
commit 4b01c9e04e
1 changed files with 3 additions and 3 deletions

View File

@ -170,6 +170,9 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
LastPinCommonUnit = dlg.GetAddToAllParts(); LastPinCommonUnit = dlg.GetAddToAllParts();
LastPinVisible = dlg.GetVisible(); LastPinVisible = dlg.GetVisible();
if( !pin->InEditMode() )
SaveCopyInUndoList( pin->GetParent() );
pin->EnableEditMode( true, SynchronizePins()? false : true ); pin->EnableEditMode( true, SynchronizePins()? false : true );
pin->SetName( dlg.GetPinName() ); pin->SetName( dlg.GetPinName() );
pin->SetNameTextSize( GetLastPinNameSize() ); pin->SetNameTextSize( GetLastPinNameSize() );
@ -187,9 +190,6 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
if( pin->IsModified() || pin->IsNew() ) if( pin->IsModified() || pin->IsNew() )
{ {
if( !pin->InEditMode() )
SaveCopyInUndoList( pin->GetParent() );
OnModify( ); OnModify( );
MSG_PANEL_ITEMS items; MSG_PANEL_ITEMS items;