Comments.

This commit is contained in:
Maciej Suminski 2013-12-09 11:07:30 +01:00
parent a3909d4f71
commit 7e60cc530a
2 changed files with 4 additions and 4 deletions

View File

@ -238,15 +238,15 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent )
// Get a copy of the selected items set // Get a copy of the selected items set
std::set<BOARD_ITEM*> selectedItems = m_selectionTool->GetSelection().items; std::set<BOARD_ITEM*> selectedItems = m_selectionTool->GetSelection().items;
// As we are about to remove items, they have to be removed from the selection // As we are about to remove items, they have to be removed from the selection first
m_selectionTool->ClearSelection(); m_selectionTool->ClearSelection();
std::set<BOARD_ITEM*>::iterator it; std::set<BOARD_ITEM*>::iterator it;
for( it = selectedItems.begin(); it != selectedItems.end(); ++it ) for( it = selectedItems.begin(); it != selectedItems.end(); ++it )
remove( *it ); remove( *it );
BOARD* board = getModel<BOARD>( PCB_T );
// Rebuild list of pads and nets if necessary // Rebuild list of pads and nets if necessary
BOARD* board = getModel<BOARD>( PCB_T );
if( !( board->GetStatus() & NET_CODES_OK ) ) if( !( board->GetStatus() & NET_CODES_OK ) )
board->BuildListOfNets(); board->BuildListOfNets();
@ -276,10 +276,9 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
getView()->Remove( &module->Reference() ); getView()->Remove( &module->Reference() );
getView()->Remove( &module->Value() ); getView()->Remove( &module->Value() );
// Module itself is deleted after the switch scope // 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()
// module->ClearFlags(); // TODO is it necessary? clearing ratsnest/list of pads?
// Clear flags to indicate, that the ratsnest, list of nets & pads are not valid anymore // Clear flags to indicate, that the ratsnest, list of nets & pads are not valid anymore
board->m_Status_Pcb = 0; board->m_Status_Pcb = 0;
} }

View File

@ -102,6 +102,7 @@ private:
///> Flag determining if anything is being dragged right now ///> Flag determining if anything is being dragged right now
bool m_dragging; bool m_dragging;
///> Removes and frees a single BOARD_ITEM.
void remove( BOARD_ITEM* aItem ); void remove( BOARD_ITEM* aItem );
///> Sets up handlers for various events ///> Sets up handlers for various events