mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
When undoing creation of the sheet, get out first
We can't stay in a sheet that is deleted by the action of undo. Checks the current sheet and, if we are currently using it, ensures that the following action is to leave the current sheet Fixes https://gitlab.com/kicad/code/kicad/issues/10733 (cherry picked from commit ccf2a63f45f2a33bb69bf35da2f06a694f1b0115)
This commit is contained in:
parent
92dc06ac9d
commit
b7c31d3b5b
@ -22,6 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <ee_actions.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <schematic.h>
|
||||
@ -283,7 +284,13 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
}
|
||||
if( status == UNDO_REDO::NEWITEM )
|
||||
{
|
||||
// new items are deleted on undo
|
||||
// If we are removing the current sheet, get out first
|
||||
if( SCH_SHEET* sheet = dyn_cast<SCH_SHEET*>( eda_item ) )
|
||||
{
|
||||
if( sheet->GetScreen() == GetScreen() )
|
||||
GetToolManager()->RunAction( EE_ACTIONS::leaveSheet );
|
||||
}
|
||||
|
||||
RemoveFromScreen( eda_item, screen );
|
||||
aList->SetPickedItemStatus( UNDO_REDO::DELETED, ii );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user