diff --git a/common/footprint_info.cpp b/common/footprint_info.cpp index f16667d5a2..62983c5e68 100644 --- a/common/footprint_info.cpp +++ b/common/footprint_info.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -77,6 +78,24 @@ bool FOOTPRINT_INFO::InLibrary( const wxString& aLibrary ) const } +/** + * Less than operator implementation for FOOTPRINT_INFO + */ +bool operator<( const FOOTPRINT_INFO& lhs, const FOOTPRINT_INFO& rhs ) +{ + int retv = StrNumCmp( lhs.m_nickname, rhs.m_nickname, false ); + + if( retv != 0 ) + return retv < 0; + + // Technically footprint names are not case sensitive because the file name is used + // as the footprint name. On windows this would be problematic because windows does + // not support case sensitive file names by default. This should not cause any issues + // and allow for a future change to use the name defined in the footprint file. + return StrNumCmp( lhs.m_fpname, rhs.m_fpname, false ) < 0; +} + + void FOOTPRINT_LIST::DisplayErrors( wxTopLevelWindow* aWindow ) { // @todo: go to a more HTML !! ? centric output, possibly with diff --git a/common/widgets/net_selector.cpp b/common/widgets/net_selector.cpp index 1773e14dac..ffa4e52b75 100644 --- a/common/widgets/net_selector.cpp +++ b/common/widgets/net_selector.cpp @@ -21,6 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include diff --git a/include/footprint_info.h b/include/footprint_info.h index 4e53b2421f..0f3d26d541 100644 --- a/include/footprint_info.h +++ b/include/footprint_info.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -138,6 +137,11 @@ public: */ bool InLibrary( const wxString& aLibrary ) const; + /** + * Less than comparison operator, intended for sorting FOOTPRINT_INFO objects + */ + friend bool operator<( const FOOTPRINT_INFO& lhs, const FOOTPRINT_INFO& rhs ); + protected: void ensure_loaded() { @@ -162,22 +166,6 @@ protected: }; -/// FOOTPRINT object list sort function. -inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 ) -{ - int retv = StrNumCmp( item1.m_nickname, item2.m_nickname, false ); - - if( retv != 0 ) - return retv < 0; - - // Technically footprint names are not case sensitive because the file name is used - // as the footprint name. On windows this would be problematic because windows does - // not support case sensitive file names by default. This should not cause any issues - // and allow for a future change to use the name defined in the footprint file. - return StrNumCmp( item1.m_fpname, item2.m_fpname, false ) < 0; -} - - /** * Holds a list of FOOTPRINT_INFO objects, along with a list of IO_ERRORs or * PARSE_ERRORs that were thrown acquiring the FOOTPRINT_INFOs. diff --git a/pcbnew/board_connected_item.cpp b/pcbnew/board_connected_item.cpp index 56985b9fa4..a4da9b8a18 100644 --- a/pcbnew/board_connected_item.cpp +++ b/pcbnew/board_connected_item.cpp @@ -27,6 +27,7 @@ #include #include #include +#include using namespace std::placeholders; @@ -118,6 +119,22 @@ wxString BOARD_CONNECTED_ITEM::GetNetClassName() const } +wxString BOARD_CONNECTED_ITEM::GetNetnameMsg() const +{ + if( !GetBoard() ) + return wxT( "[** NO BOARD DEFINED **]" ); + + wxString netname = GetNetname(); + + if( !netname.length() ) + return wxT( "[]" ); + else if( GetNetCode() < 0 ) + return wxT( "[" + UnescapeString( netname ) + "](" + _( "Not Found" ) + ")" ); + else + return wxT( "[" + UnescapeString( netname ) + "]" ); +} + + static struct BOARD_CONNECTED_ITEM_DESC { BOARD_CONNECTED_ITEM_DESC() diff --git a/pcbnew/board_connected_item.h b/pcbnew/board_connected_item.h index 45625e3efb..7a343e50a5 100644 --- a/pcbnew/board_connected_item.h +++ b/pcbnew/board_connected_item.h @@ -29,7 +29,6 @@ #include #include #include -#include class NETCLASS; class TRACK; @@ -132,20 +131,7 @@ public: * @return wxString - the full netname or "" in square braces, followed by * "(Not Found)" if the netcode is undefined. */ - wxString GetNetnameMsg() const - { - if( !GetBoard() ) - return wxT( "[** NO BOARD DEFINED **]" ); - - wxString netname = GetNetname(); - - if( !netname.length() ) - return wxT( "[]" ); - else if( GetNetCode() < 0 ) - return wxT( "[" + UnescapeString( netname ) + "](" + _( "Not Found" ) + ")" ); - else - return wxT( "[" + UnescapeString( netname ) + "]" ); - } + wxString GetNetnameMsg() const; /** * Function GetShortNetname diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index dcd2dcb8e2..8980b22fac 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 1a282f15ed..c4dd8b939c 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 58f8c0ec07..9c57d1c4b1 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index aa90298782..64cfb8f14d 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/connectivity/from_to_cache.cpp b/pcbnew/connectivity/from_to_cache.cpp index bee76f3b28..ee7c25fdfd 100644 --- a/pcbnew/connectivity/from_to_cache.cpp +++ b/pcbnew/connectivity/from_to_cache.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include diff --git a/pcbnew/dialogs/dialog_select_net_from_list.cpp b/pcbnew/dialogs/dialog_select_net_from_list.cpp index e38a1ab6c2..d11567d5d9 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list.cpp +++ b/pcbnew/dialogs/dialog_select_net_from_list.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index d59ec651d8..3cfb6678d0 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/footprint_info_impl.cpp b/pcbnew/footprint_info_impl.cpp index f3bf9dbfc7..2a090ec346 100644 --- a/pcbnew/footprint_info_impl.cpp +++ b/pcbnew/footprint_info_impl.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/fp_tree_model_adapter.cpp b/pcbnew/fp_tree_model_adapter.cpp index bbc629cdb7..b5772f0bc8 100644 --- a/pcbnew/fp_tree_model_adapter.cpp +++ b/pcbnew/fp_tree_model_adapter.cpp @@ -18,6 +18,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/fp_tree_synchronizing_adapter.cpp b/pcbnew/fp_tree_synchronizing_adapter.cpp index a174bf7894..054799cc10 100644 --- a/pcbnew/fp_tree_synchronizing_adapter.cpp +++ b/pcbnew/fp_tree_synchronizing_adapter.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index ff7daefbfe..1b2fd1ec55 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include "pcb_netlist.h" #include diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index bfbbcdfb25..92318e58fd 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index a36597104e..6436666f92 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include