diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index fe051b71e2..33b0b5fdc0 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -283,7 +283,10 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags ) } if( schItem->Type() == SCH_GROUP_T ) + { + wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." ); addedGroup = static_cast( schItem ); + } if( frame ) frame->UpdateItem( schItem, true, true ); @@ -374,6 +377,12 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags ) ent.m_copy = nullptr; // We've transferred ownership to the undo list } + if( schItem->Type() == SCH_GROUP_T ) + { + wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." ); + addedGroup = static_cast( schItem ); + } + if( frame ) frame->UpdateItem( schItem, false, true ); diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index f0e5ee28bf..d531210500 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -320,7 +320,10 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags ) } if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T ) + { + wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." ); addedGroup = static_cast( boardItem ); + } if( boardItem->Type() != PCB_MARKER_T ) propagateDamage( boardItem, staleZones ); @@ -467,6 +470,12 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags ) connectivity->Update( boardItem ); } + if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T ) + { + wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." ); + addedGroup = static_cast( boardItem ); + } + if( boardItem->Type() != PCB_MARKER_T ) { propagateDamage( boardItemCopy, staleZones ); // before