Rewrite GROUP undo based on uuids.

This also removes the GROUP/UNGROUP-specific undo actions.

This also fixes a bunch of undo bugs when duplicating
group members, creating pins, etc.

This also fixes some undo bugs when dividing wires etc.

This also fixes some bugs with new sch items not
being created within an entered group.
This commit is contained in:
Jeff Young
2025-05-21 14:24:59 +01:00
parent 2b5b3ffb8d
commit f58fc0b952
136 changed files with 1058 additions and 1631 deletions
+3 -3
View File
@@ -270,9 +270,9 @@ std::unique_ptr<COMMIT> API_HANDLER_PCB::createCommit()
std::optional<BOARD_ITEM*> API_HANDLER_PCB::getItemById( const KIID& aId ) const
{
BOARD_ITEM* item = frame()->GetBoard()->GetItem( aId );
BOARD_ITEM* item = frame()->GetBoard()->ResolveItem( aId, true );
if( item == DELETED_BOARD_ITEM::GetInstance() )
if( !item )
return std::nullopt;
return item;
@@ -649,7 +649,7 @@ void API_HANDLER_PCB::deleteItemsInternal( std::map<KIID, ItemDeletionStatus>& a
for( std::pair<const KIID, ItemDeletionStatus> pair : aItemsToDelete )
{
if( BOARD_ITEM* item = board->GetItem( pair.first ) )
if( BOARD_ITEM* item = board->ResolveItem( pair.first, true ) )
{
validatedItems.push_back( item );
aItemsToDelete[pair.first] = ItemDeletionStatus::IDS_OK;