Fixed zone area removal (& undoing) using the EDIT_TOOL.

This commit is contained in:
Maciej Suminski 2013-12-18 17:16:15 +01:00
parent fb78432367
commit 7ce91d4e38
1 changed files with 2 additions and 15 deletions

View File

@ -303,16 +303,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
{ {
MODULE* module = static_cast<MODULE*>( aItem ); MODULE* module = static_cast<MODULE*>( aItem );
module->ClearFlags(); module->ClearFlags();
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Remove ), getView() ) );
for( D_PAD* pad = module->Pads().GetFirst(); pad; pad = pad->Next() )
getView()->Remove( pad );
for( BOARD_ITEM* drawing = module->GraphicalItems().GetFirst(); drawing;
drawing = drawing->Next() )
getView()->Remove( drawing );
getView()->Remove( &module->Reference() );
getView()->Remove( &module->Value() );
// Module itself is deleted after the switch scope is finished // Module itself is deleted after the switch scope is finished
// list of pads is rebuild by BOARD::BuildListOfNets() // list of pads is rebuild by BOARD::BuildListOfNets()
@ -322,11 +313,6 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
} }
break; break;
case PCB_ZONE_AREA_T:
getView()->Remove( aItem );
getModel<BOARD>( PCB_T )->Delete( aItem );
return;
// These are not supposed to be removed // These are not supposed to be removed
case PCB_PAD_T: case PCB_PAD_T:
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
@ -341,6 +327,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
case PCB_TARGET_T: // a target (graphic item) case PCB_TARGET_T: // a target (graphic item)
case PCB_MARKER_T: // a marker used to show something case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_T: // SEG_ZONE items are now deprecated case PCB_ZONE_T: // SEG_ZONE items are now deprecated
case PCB_ZONE_AREA_T:
break; break;
default: // other types do not need to (or should not) be handled default: // other types do not need to (or should not) be handled