EEschema/Cvpcb: make assign footprints from CvPcb undoable.

Fixes #11508
https://gitlab.com/kicad/code/kicad/issues/11508
This commit is contained in:
jean-pierre charras 2022-05-02 12:49:14 +02:00
parent 772bdc4bbf
commit 40c75c74fa
1 changed files with 7 additions and 0 deletions

View File

@ -47,6 +47,7 @@ void SCH_EDITOR_CONTROL::AssignFootprints( const std::string& aChangedSetOfRefer
SCH_REFERENCE_LIST refs;
SCH_SHEET_LIST sheets = m_frame->Schematic().GetSheets();
bool isChanged = false;
bool appendToUndoList = false;
sheets.GetSymbols( refs, false );
@ -96,6 +97,12 @@ void SCH_EDITOR_CONTROL::AssignFootprints( const std::string& aChangedSetOfRefer
if( oldfp != footprint )
{
isChanged = true;
SCH_SCREEN* screen = refs[ii].GetSheetPath().LastScreen();
m_frame->SaveCopyInUndoList( screen, symbol, UNDO_REDO::CHANGED,
appendToUndoList, false );
appendToUndoList = true;
symbol->SetFootprint( sheetPath, footprint );
}
}