Browse Source

Fix compil warnings (UNDO_REDO::GROUP renamed to UNDO_REDO::REGROUP to fix

collision name with a widows header on msys2)
6.0.7
jean-pierre charras 4 years ago
parent
commit
6c7c9ca50c
  1. 2
      include/tool/tool_event.h
  2. 7
      include/undo_redo_container.h
  3. 4
      pcbnew/tools/group_tool.cpp
  4. 6
      pcbnew/undo_redo.cpp

2
include/tool/tool_event.h

@ -444,7 +444,7 @@ public:
template<typename T>
void SetParameter(T aParam)
{
m_param = (void*) aParam;
m_param = reinterpret_cast<void*>( aParam );
}
OPT<int> GetCommandId() const

7
include/undo_redo_container.h

@ -3,7 +3,7 @@
*
* Copyright (C) 2009 jean-pierre.charras@gipsa-lab.inpg.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2009-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2009-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -68,8 +68,9 @@ enum class UNDO_REDO {
DRILLORIGIN, // origin changed (like CHANGED, contains the origin and a copy)
GRIDORIGIN, // origin changed (like CHANGED, contains the origin and a copy)
PAGESETTINGS, // page settings or title block changes
GROUP,
UNGROUP
REGROUP, // new group of items created (do not use GROUP to avoid collision
// with an header on msys2)
UNGROUP // existing group destroyed (items not destroyed)
};

4
pcbnew/tools/group_tool.cpp

@ -279,10 +279,10 @@ int GROUP_TOOL::Group( const TOOL_EVENT& aEvent )
for( EDA_ITEM* item : selection )
{
group->AddItem( static_cast<BOARD_ITEM*>( item ) );
undoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::GROUP ) );
undoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::REGROUP ) );
}
m_frame->SaveCopyInUndoList( undoList, UNDO_REDO::GROUP );
m_frame->SaveCopyInUndoList( undoList, UNDO_REDO::REGROUP );
}
selTool->ClearSelection();

6
pcbnew/undo_redo.cpp

@ -284,7 +284,7 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis
case UNDO_REDO::NEWITEM:
case UNDO_REDO::DELETED:
case UNDO_REDO::PAGESETTINGS:
case UNDO_REDO::GROUP:
case UNDO_REDO::REGROUP:
case UNDO_REDO::UNGROUP:
break;
@ -489,13 +489,13 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
break;
case UNDO_REDO::GROUP:
case UNDO_REDO::REGROUP:
aList->SetPickedItemStatus( UNDO_REDO::UNGROUP, ii );
static_cast<BOARD_ITEM*>( eda_item )->SetParentGroup( nullptr );
break;
case UNDO_REDO::UNGROUP:
aList->SetPickedItemStatus( UNDO_REDO::GROUP, ii );
aList->SetPickedItemStatus( UNDO_REDO::REGROUP, ii );
if( group )
group->AddItem( static_cast<BOARD_ITEM*>( eda_item ) );

Loading…
Cancel
Save