diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index 33ed715d9c..21629db51b 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -227,6 +227,17 @@ bool PCB_ARC::operator==( const BOARD_ITEM& aBoardItem ) const } +bool PCB_ARC::operator==( const PCB_TRACK& aOther ) const +{ + if( aOther.Type() != Type() ) + return false; + + const PCB_ARC& other = static_cast( aOther ); + + return *this == other; +} + + bool PCB_ARC::operator==( const PCB_ARC& aOther ) const { return m_Start == aOther.m_Start @@ -284,6 +295,17 @@ bool PCB_VIA::operator==( const BOARD_ITEM& aBoardItem ) const } +bool PCB_VIA::operator==( const PCB_TRACK& aOther ) const +{ + if( aOther.Type() != Type() ) + return false; + + const PCB_VIA& other = static_cast( aOther ); + + return *this == other; +} + + bool PCB_VIA::operator==( const PCB_VIA& aOther ) const { return m_Start == aOther.m_Start diff --git a/pcbnew/pcb_track.h b/pcbnew/pcb_track.h index 18397f9848..7f2189714f 100644 --- a/pcbnew/pcb_track.h +++ b/pcbnew/pcb_track.h @@ -357,6 +357,9 @@ protected: virtual void swapData( BOARD_ITEM* aImage ) override; private: + // Silence GCC warning about overriding the base class method + bool operator==( const PCB_TRACK& aOther ) const override; + VECTOR2I m_Mid; ///< Arc mid point, halfway between start and end }; @@ -657,6 +660,9 @@ protected: wxString layerMaskDescribe() const override; private: + // Silence GCC warning about hiding the PCB_TRACK base method + bool operator==( const PCB_TRACK& aOther ) const override; + VIATYPE m_viaType; ///< through, blind/buried or micro PADSTACK m_padStack;