diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index e225e05e2b..cb91124f31 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -137,6 +137,11 @@ struct TOOL_MANAGER::TOOL_STATE return aRhs.theTool != this->theTool; } + /** + * Function Push() + * Stores the current state of the tool on stack. Stacks are stored internally and are not + * shared between different TOOL_STATE objects. + */ void Push() { stateStack.push( *this ); @@ -144,6 +149,12 @@ struct TOOL_MANAGER::TOOL_STATE clear(); } + /** + * Function Pop() + * Restores state of the tool from stack. Stacks are stored internally and are not + * shared between different TOOL_STATE objects. + * @return True if state was restored, false if the stack was empty. + */ bool Pop() { delete cofunc; @@ -603,7 +614,7 @@ bool TOOL_MANAGER::SaveClipboard( const std::string& aText ) { if( wxTheClipboard->Open() ) { - wxTheClipboard->SetData( new wxTextDataObject( aText ) ); + wxTheClipboard->SetData( new wxTextDataObject( wxString( aText.c_str(), wxConvUTF8 ) ) ); wxTheClipboard->Close(); return true; diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index f1d304817c..6496692a47 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -688,10 +688,12 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl ) m_Status_Pcb = 0; break; + case PCB_MODULE_EDGE_T: + assert( false ); // TODO Orson: I am just checking if it is supposed to be here + case PCB_DIMENSION_T: case PCB_LINE_T: case PCB_TEXT_T: - case PCB_MODULE_EDGE_T: case PCB_TARGET_T: if( aControl & ADD_APPEND ) m_Drawings.PushBack( aBoardItem ); diff --git a/pcbnew/ratsnest_data.cpp b/pcbnew/ratsnest_data.cpp index 9271f00f42..3c069e1932 100644 --- a/pcbnew/ratsnest_data.cpp +++ b/pcbnew/ratsnest_data.cpp @@ -305,7 +305,7 @@ void RN_NET::clearNode( const RN_NODE_PTR& aNode ) // Remove all ratsnest edges for associated with the node newEnd = std::remove_if( m_rnEdges->begin(), m_rnEdges->end(), - boost::bind( isEdgeConnectingNode, _1, aNode ) ); + boost::bind( isEdgeConnectingNode, _1, boost::ref( aNode ) ) ); m_rnEdges->resize( std::distance( m_rnEdges->begin(), newEnd ) ); } @@ -629,7 +629,7 @@ std::list RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN closest.push_back( node ); // Sort by the distance from aNode - closest.sort( boost::bind( sortDistance, aNode, _1, _2 ) ); + closest.sort( boost::bind( sortDistance, boost::ref( aNode ), _1, _2 ) ); // Remove the first node (==aNode), as it is surely located within the smallest distance closest.pop_front(); @@ -653,7 +653,7 @@ std::list RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, closest.push_back( node ); // Sort by the distance from aNode - closest.sort( boost::bind( sortDistance, aNode, _1, _2 ) ); + closest.sort( boost::bind( sortDistance, boost::ref( aNode ), _1, _2 ) ); // Remove the first node (==aNode), as it is surely located within the smallest distance closest.pop_front(); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 782fe5f90d..5eb6620c7a 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -483,7 +483,7 @@ int EDIT_TOOL::PasteItems( TOOL_EVENT& aEvent ) try { - BOARD_ITEM* item = io.Parse( m_toolMgr->GetClipboard() ); + BOARD_ITEM* item = io.Parse( wxString( m_toolMgr->GetClipboard().c_str(), wxConvUTF8 ) ); assert( item->Type() == PCB_MODULE_T ); pastedModule = dyn_cast( item ); }