Make sure items are removed from groups when deleted.
Fixes https://gitlab.com/kicad/code/kicad/issues/7387
This commit is contained in:
parent
c98c7cf200
commit
d261fa3792
|
@ -738,6 +738,9 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aRemoveMode )
|
|||
wxFAIL_MSG( wxT( "BOARD::Remove() needs more ::Type() support" ) );
|
||||
}
|
||||
|
||||
if( aBoardItem->GetParentGroup() )
|
||||
aBoardItem->GetParentGroup()->RemoveItem( aBoardItem );
|
||||
|
||||
m_connectivity->Remove( aBoardItem );
|
||||
|
||||
if( aRemoveMode != REMOVE_MODE::BULK )
|
||||
|
@ -2011,7 +2014,9 @@ wxString BOARD::GroupsSanityCheck( bool repair )
|
|||
{
|
||||
if( repair )
|
||||
{
|
||||
while( GroupsSanityCheckInternal( repair ) != wxEmptyString );
|
||||
while( GroupsSanityCheckInternal( repair ) != wxEmptyString )
|
||||
{};
|
||||
|
||||
return wxEmptyString;
|
||||
}
|
||||
return GroupsSanityCheckInternal( repair );
|
||||
|
|
|
@ -193,12 +193,14 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
|
||||
switch( boardItem->Type() )
|
||||
{
|
||||
// Module items
|
||||
// Footprint items
|
||||
case PCB_PAD_T:
|
||||
case PCB_FP_SHAPE_T:
|
||||
case PCB_FP_TEXT_T:
|
||||
case PCB_FP_ZONE_T:
|
||||
// This level can only handle footprint children when editing footprints
|
||||
// This level can only handle footprint children in the footprint editor as
|
||||
// only in that case has the entire footprint (and all its children) already
|
||||
// been saved for undo.
|
||||
wxASSERT( m_isFootprintEditor );
|
||||
|
||||
if( boardItem->Type() == PCB_FP_TEXT_T )
|
||||
|
@ -210,6 +212,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
break;
|
||||
}
|
||||
|
||||
if( boardItem->GetParentGroup() )
|
||||
boardItem->GetParentGroup()->RemoveItem( boardItem );
|
||||
|
||||
view->Remove( boardItem );
|
||||
|
||||
if( !( changeFlags & CHT_DONE ) )
|
||||
|
|
|
@ -562,6 +562,9 @@ void FOOTPRINT::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode )
|
|||
wxFAIL_MSG( msg );
|
||||
}
|
||||
}
|
||||
|
||||
if( aBoardItem->GetParentGroup() )
|
||||
aBoardItem->GetParentGroup()->RemoveItem( aBoardItem );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue