Remove some dead code. A little bit of comment cleanup as well.
This commit is contained in:
parent
b08862e445
commit
cf42d692bf
|
@ -796,9 +796,8 @@ public:
|
|||
* Restore an undo or redo command to put data pointed by \a aList in the previous state.
|
||||
*
|
||||
* @param aList a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
|
||||
* @param aRedoCommand a bool: true for redo, false for undo
|
||||
*/
|
||||
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand );
|
||||
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList );
|
||||
|
||||
/**
|
||||
* Free the undo or redo list from \a aList element.
|
||||
|
|
|
@ -252,7 +252,7 @@ void SCH_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
|
|||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand )
|
||||
void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
{
|
||||
// Undo in the reverse order of list creation: (this can allow stacked changes like the
|
||||
// same item can be changed and deleted in the same complex command).
|
||||
|
@ -348,7 +348,7 @@ void SCH_EDIT_FRAME::RollbackSchematicFromUndo()
|
|||
|
||||
if( undo )
|
||||
{
|
||||
PutDataInPreviousState( undo, false );
|
||||
PutDataInPreviousState( undo );
|
||||
undo->ClearListAndDeleteItems();
|
||||
delete undo;
|
||||
|
||||
|
|
|
@ -1159,7 +1159,7 @@ int SCH_EDITOR_CONTROL::Undo( const TOOL_EVENT& aEvent )
|
|||
PICKED_ITEMS_LIST* List = m_frame->PopCommandFromUndoList();
|
||||
|
||||
/* Undo the command */
|
||||
m_frame->PutDataInPreviousState( List, false );
|
||||
m_frame->PutDataInPreviousState( List );
|
||||
|
||||
/* Put the old list in RedoList */
|
||||
List->ReversePickersListOrder();
|
||||
|
@ -1189,14 +1189,14 @@ int SCH_EDITOR_CONTROL::Redo( const TOOL_EVENT& aEvent )
|
|||
m_toolMgr->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
|
||||
|
||||
/* Get the old list */
|
||||
PICKED_ITEMS_LIST* List = m_frame->PopCommandFromRedoList();
|
||||
PICKED_ITEMS_LIST* list = m_frame->PopCommandFromRedoList();
|
||||
|
||||
/* Redo the command: */
|
||||
m_frame->PutDataInPreviousState( List, true );
|
||||
m_frame->PutDataInPreviousState( list );
|
||||
|
||||
/* Put the old list in UndoList */
|
||||
List->ReversePickersListOrder();
|
||||
m_frame->PushCommandToUndoList( List );
|
||||
list->ReversePickersListOrder();
|
||||
m_frame->PushCommandToUndoList( list );
|
||||
|
||||
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
|
||||
selTool->RebuildSelection();
|
||||
|
|
|
@ -95,9 +95,9 @@ public:
|
|||
* Add a list of pickers to handle a list of items.
|
||||
*
|
||||
* @param aItemsList the list of items modified by the command to undo.
|
||||
* @param aTypeCommand command type (see enum UNDO_REDO).
|
||||
* @param aCommandType command type (see enum UNDO_REDO).
|
||||
*/
|
||||
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand ) override;
|
||||
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aCommandType ) override;
|
||||
|
||||
/**
|
||||
* Redo the last edit:
|
||||
|
@ -125,13 +125,8 @@ public:
|
|||
* Put data pointed by List in the previous state, i.e. the state memorized by \a aList.
|
||||
*
|
||||
* @param aList a PICKED_ITEMS_LIST pointer to the list of items to undo/redo.
|
||||
* @param aRedoCommand true for redo, false for undo.
|
||||
* @param aRebuildRatsnet a bool: true to rebuild ratsnest (normal use), false to just
|
||||
* retrieve last state (used in abort commands that do not need
|
||||
* to rebuild ratsnest).
|
||||
*/
|
||||
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand,
|
||||
bool aRebuildRatsnet = true );
|
||||
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList );
|
||||
|
||||
/**
|
||||
* Check if the undo and redo operations are currently blocked.
|
||||
|
|
|
@ -851,7 +851,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
|
|||
|
||||
if( undo )
|
||||
{
|
||||
m_frame->PutDataInPreviousState( undo, false );
|
||||
m_frame->PutDataInPreviousState( undo );
|
||||
undo->ClearListAndDeleteItems();
|
||||
delete undo;
|
||||
}
|
||||
|
|
|
@ -96,15 +96,13 @@ using namespace std::placeholders;
|
|||
|
||||
/**
|
||||
* Function TestForExistingItem
|
||||
* test if aItem exists somewhere in lists of items
|
||||
* This is a function used by PutDataInPreviousState to be sure an item was not deleted
|
||||
* since an undo or redo.
|
||||
* Test if aItem exists somewhere in undo/redo lists of items. Used by PutDataInPreviousState
|
||||
* to be sure an item was not deleted since an undo or redo.
|
||||
* This could be possible:
|
||||
* - if a call to SaveCopyInUndoList was forgotten in Pcbnew
|
||||
* - in zones outlines, when a change in one zone merges this zone with an other
|
||||
* This function avoids a Pcbnew crash
|
||||
* Before using this function to test existence of items,
|
||||
* it must be called with aItem = NULL to prepare the list
|
||||
* Before using this function to test existence of items, it must be called with aItem = NULL to
|
||||
* prepare the list
|
||||
* @param aPcb = board to test
|
||||
* @param aItem = item to find
|
||||
* = NULL to build the list of existing items
|
||||
|
@ -185,7 +183,7 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( EDA_ITEM* aItem, UNDO_REDO aComman
|
|||
|
||||
|
||||
void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
|
||||
UNDO_REDO aTypeCommand )
|
||||
UNDO_REDO aCommandType )
|
||||
{
|
||||
PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
|
||||
|
||||
|
@ -257,7 +255,7 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis
|
|||
|
||||
if( command == UNDO_REDO::UNSPECIFIED )
|
||||
{
|
||||
command = aTypeCommand;
|
||||
command = aCommandType;
|
||||
commandToUndo->SetPickedItemStatus( command, ii );
|
||||
}
|
||||
|
||||
|
@ -326,14 +324,14 @@ void PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
|
|||
m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
|
||||
|
||||
// Get the old list
|
||||
PICKED_ITEMS_LIST* List = PopCommandFromUndoList();
|
||||
PICKED_ITEMS_LIST* list = PopCommandFromUndoList();
|
||||
|
||||
// Undo the command
|
||||
PutDataInPreviousState( List, false );
|
||||
PutDataInPreviousState( list );
|
||||
|
||||
// Put the old list in RedoList
|
||||
List->ReversePickersListOrder();
|
||||
PushCommandToRedoList( List );
|
||||
list->ReversePickersListOrder();
|
||||
PushCommandToRedoList( list );
|
||||
|
||||
OnModify();
|
||||
|
||||
|
@ -355,14 +353,14 @@ void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent )
|
|||
m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
|
||||
|
||||
// Get the old list
|
||||
PICKED_ITEMS_LIST* List = PopCommandFromRedoList();
|
||||
PICKED_ITEMS_LIST* list = PopCommandFromRedoList();
|
||||
|
||||
// Redo the command
|
||||
PutDataInPreviousState( List, true );
|
||||
PutDataInPreviousState( list );
|
||||
|
||||
// Put the old list in UndoList
|
||||
List->ReversePickersListOrder();
|
||||
PushCommandToUndoList( List );
|
||||
list->ReversePickersListOrder();
|
||||
PushCommandToUndoList( list );
|
||||
|
||||
OnModify();
|
||||
|
||||
|
@ -372,8 +370,7 @@ void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent )
|
|||
}
|
||||
|
||||
|
||||
void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand,
|
||||
bool aRebuildRatsnet )
|
||||
void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
{
|
||||
bool not_found = false;
|
||||
bool reBuild_ratsnest = false;
|
||||
|
@ -580,7 +577,7 @@ void PCB_BASE_EDIT_FRAME::ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aIt
|
|||
void PCB_BASE_EDIT_FRAME::RollbackFromUndo()
|
||||
{
|
||||
PICKED_ITEMS_LIST* undo = PopCommandFromUndoList();
|
||||
PutDataInPreviousState( undo, false );
|
||||
PutDataInPreviousState( undo );
|
||||
|
||||
undo->ClearListAndDeleteItems();
|
||||
delete undo;
|
||||
|
|
Loading…
Reference in New Issue