From 89a5f8ce695685bd2f39c50bf4dd095537b74170 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 28 Nov 2016 15:31:56 +0100 Subject: [PATCH] Remove boost::bind from BOARD_COMMIT --- pcbnew/board_commit.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 798f931160..a72d4ed46d 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -29,11 +29,11 @@ #include #include #include - -#include - #include +#include +using namespace std::placeholders; + BOARD_COMMIT::BOARD_COMMIT( PCB_TOOL* aTool ) { m_toolMgr = aTool->GetManager(); @@ -117,7 +117,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage ) if( boardItem->Type() == PCB_MODULE_T ) { MODULE* mod = static_cast( boardItem ); - mod->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + mod->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); } } else @@ -220,7 +220,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage ) MODULE* module = static_cast( boardItem ); module->ClearFlags(); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); view->Remove( module ); @@ -263,6 +263,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage ) if( !m_editModules ) frame->SaveCopyInUndoList( undoList, UR_UNSPECIFIED ); + if( TOOL_MANAGER* toolMgr = frame->GetToolManager() ) + toolMgr->PostEvent( { TC_MESSAGE, TA_MODEL_CHANGE, AS_GLOBAL } ); + ratsnest->Recalculate(); frame->OnModify(); frame->UpdateMsgPanel(); @@ -306,7 +309,7 @@ void BOARD_COMMIT::Revert() if( item->Type() == PCB_MODULE_T ) { MODULE* oldModule = static_cast( item ); - oldModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + oldModule->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); } view->Remove( item ); @@ -317,8 +320,8 @@ void BOARD_COMMIT::Revert() if( item->Type() == PCB_MODULE_T ) { MODULE* newModule = static_cast( item ); - newModule->RunOnChildren( boost::bind( &EDA_ITEM::ClearFlags, _1, SELECTED ) ); - newModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + newModule->RunOnChildren( std::bind( &EDA_ITEM::ClearFlags, _1, SELECTED ) ); + newModule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); } view->Add( item ); @@ -330,7 +333,7 @@ void BOARD_COMMIT::Revert() if( item->Type() == PCB_MODULE_T ) { MODULE* oldModule = static_cast( item ); - oldModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + oldModule->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); } view->Remove( item ); @@ -345,8 +348,8 @@ void BOARD_COMMIT::Revert() if( item->Type() == PCB_MODULE_T ) { MODULE* newModule = static_cast( item ); - newModule->RunOnChildren( boost::bind( &EDA_ITEM::ClearFlags, _1, SELECTED ) ); - newModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + newModule->RunOnChildren( std::bind( &EDA_ITEM::ClearFlags, _1, SELECTED ) ); + newModule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); } view->Add( item );