Removed const modifier for returned non-reference types

This commit is contained in:
Maciej Suminski 2020-02-02 18:52:19 +01:00 committed by Tomasz Wlostowski
parent 509cd8f495
commit 89698a727b
21 changed files with 27 additions and 31 deletions

View File

@ -98,6 +98,8 @@ public:
// Do not create a copy constructor & operator=. // Do not create a copy constructor & operator=.
// The ones generated by the compiler are adequate. // The ones generated by the compiler are adequate.
virtual wxPoint GetPosition() const = 0;
/** /**
* Function GetCenter() * Function GetCenter()
* *
@ -106,7 +108,7 @@ public:
* *
* @return centre point of the item * @return centre point of the item
*/ */
virtual const wxPoint GetCenter() const { return GetPosition(); } virtual wxPoint GetCenter() const { return GetPosition(); }
virtual void SetPosition( const wxPoint& aPos ) = 0; virtual void SetPosition( const wxPoint& aPos ) = 0;

View File

@ -103,7 +103,7 @@ public:
m_position = VECTOR2D( aPosition ); m_position = VECTOR2D( aPosition );
} }
inline const wxPoint GetPosition() const override inline wxPoint GetPosition() const override
{ {
return wxPoint( m_position.x, m_position.y ); return wxPoint( m_position.x, m_position.y );
} }

View File

@ -224,7 +224,7 @@ void BOARD::ClearProject()
} }
const wxPoint BOARD::GetPosition() const wxPoint BOARD::GetPosition() const
{ {
return ZeroOffset; return ZeroOffset;
} }

View File

@ -305,7 +305,7 @@ public:
BOARD(); BOARD();
~BOARD(); ~BOARD();
const wxPoint GetPosition() const override; wxPoint GetPosition() const override;
void SetPosition( const wxPoint& aPos ) override; void SetPosition( const wxPoint& aPos ) override;
bool IsEmpty() const bool IsEmpty() const

View File

@ -61,7 +61,7 @@ void DIMENSION::SetPosition( const wxPoint& aPos )
} }
const wxPoint DIMENSION::GetPosition() const wxPoint DIMENSION::GetPosition() const
{ {
return m_Text.GetTextPos(); return m_Text.GetTextPos();
} }

View File

@ -106,9 +106,9 @@ public:
int GetValue() const { return m_Value; } int GetValue() const { return m_Value; }
const wxPoint GetPosition() const override; wxPoint GetPosition() const override;
void SetPosition( const wxPoint& aPos ) override; void SetPosition( const wxPoint& aPos ) override;
void SetTextSize( const wxSize& aTextSize ) void SetTextSize( const wxSize& aTextSize )
{ {

View File

@ -63,7 +63,7 @@ void DRAWSEGMENT::SetPosition( const wxPoint& aPos )
} }
const wxPoint DRAWSEGMENT::GetPosition() const wxPoint DRAWSEGMENT::GetPosition() const
{ {
if( m_Shape == S_POLYGON ) if( m_Shape == S_POLYGON )
return (wxPoint) m_Poly.CVertex( 0 ); return (wxPoint) m_Poly.CVertex( 0 );
@ -302,7 +302,7 @@ void DRAWSEGMENT::RebuildBezierToSegmentsPointsList( int aMinSegLen )
} }
const wxPoint DRAWSEGMENT::GetCenter() const wxPoint DRAWSEGMENT::GetCenter() const
{ {
wxPoint c; wxPoint c;
@ -333,7 +333,7 @@ const wxPoint DRAWSEGMENT::GetCenter() const
} }
const wxPoint DRAWSEGMENT::GetArcEnd() const wxPoint DRAWSEGMENT::GetArcEnd() const
{ {
wxPoint endPoint( m_End ); // start of arc wxPoint endPoint( m_End ); // start of arc
@ -355,7 +355,7 @@ const wxPoint DRAWSEGMENT::GetArcEnd() const
} }
const wxPoint DRAWSEGMENT::GetArcMid() const wxPoint DRAWSEGMENT::GetArcMid() const
{ {
wxPoint endPoint( m_End ); wxPoint endPoint( m_End );

View File

@ -122,7 +122,7 @@ public:
const wxPoint& GetBezControl2() const { return m_BezierC2; } const wxPoint& GetBezControl2() const { return m_BezierC2; }
void SetPosition( const wxPoint& aPos ) override; void SetPosition( const wxPoint& aPos ) override;
const wxPoint GetPosition() const override; wxPoint GetPosition() const override;
/** /**
* Function GetStart * Function GetStart
@ -150,7 +150,6 @@ public:
const wxPoint& GetArcStart() const { return m_End; } const wxPoint& GetArcStart() const { return m_End; }
const wxPoint GetArcEnd() const; const wxPoint GetArcEnd() const;
const wxPoint GetArcMid() const; const wxPoint GetArcMid() const;
void GetRectCorners( std::vector<wxPoint>* pts ) const;
/** /**
* function GetArcAngleStart() * function GetArcAngleStart()
@ -182,11 +181,6 @@ public:
*/ */
void SetCenter( const wxPoint& aCenterPoint ) { m_Start = aCenterPoint; } void SetCenter( const wxPoint& aCenterPoint ) { m_Start = aCenterPoint; }
const wxPoint GetFocusPosition() const override
{
return GetCenter();
}
/** /**
* Function GetParentModule * Function GetParentModule
* returns a pointer to the parent module, or NULL if DRAWSEGMENT does not * returns a pointer to the parent module, or NULL if DRAWSEGMENT does not

View File

@ -207,7 +207,7 @@ bool EDGE_MODULE::IsParentFlipped() const
return false; return false;
} }
void EDGE_MODULE::Mirror( wxPoint aCentre, bool aMirrorAroundXAxis ) void EDGE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
{ {
// Mirror an edge of the footprint. the layer is not modified // Mirror an edge of the footprint. the layer is not modified
// This is a footprint shape modification. // This is a footprint shape modification.

View File

@ -85,7 +85,7 @@ public:
* This is a footprint shape modification. * This is a footprint shape modification.
* (should be only called by a footprint editing function) * (should be only called by a footprint editing function)
*/ */
void Mirror( const wxPoint aCentre, bool aMirrorAroundXAxis ); void Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis );
/** /**
* Rotate an edge of the footprint. * Rotate an edge of the footprint.

View File

@ -68,7 +68,7 @@ public:
void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
const wxPoint GetPosition() const override { return m_Pos; } wxPoint GetPosition() const override { return m_Pos; }
void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; } void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; }
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override

View File

@ -203,7 +203,7 @@ public:
void SetPosition( const wxPoint& aPos ) override; void SetPosition( const wxPoint& aPos ) override;
const wxPoint GetPosition() const override { return m_Pos; } wxPoint GetPosition() const override { return m_Pos; }
void SetOrientation( double newangle ); void SetOrientation( double newangle );

View File

@ -63,7 +63,7 @@ public:
} }
void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; } void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; }
const wxPoint GetPosition() const override { return m_Pos; } wxPoint GetPosition() const override { return m_Pos; }
void SetShape( int aShape ) { m_Shape = aShape; } void SetShape( int aShape ) { m_Shape = aShape; }
int GetShape() const { return m_Shape; } int GetShape() const { return m_Shape; }

View File

@ -74,7 +74,7 @@ public:
return BOARD_ITEM::Matches( GetShownText(), aSearchData ); return BOARD_ITEM::Matches( GetShownText(), aSearchData );
} }
virtual const wxPoint GetPosition() const override virtual wxPoint GetPosition() const override
{ {
return EDA_TEXT::GetTextPos(); return EDA_TEXT::GetTextPos();
} }

View File

@ -93,7 +93,7 @@ public:
return BOARD_ITEM::Matches( GetShownText(), aSearchData ); return BOARD_ITEM::Matches( GetShownText(), aSearchData );
} }
virtual const wxPoint GetPosition() const override virtual wxPoint GetPosition() const override
{ {
return EDA_TEXT::GetTextPos(); return EDA_TEXT::GetTextPos();
} }

View File

@ -105,7 +105,7 @@ public:
void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
void SetPosition( const wxPoint& aPos ) override { m_Start = aPos; } void SetPosition( const wxPoint& aPos ) override { m_Start = aPos; }
const wxPoint GetPosition() const override { return m_Start; } wxPoint GetPosition() const override { return m_Start; }
const wxPoint GetFocusPosition() const override { return ( m_Start + m_End ) / 2; } const wxPoint GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
void SetWidth( int aWidth ) { m_Width = aWidth; } void SetWidth( int aWidth ) { m_Width = aWidth; }

View File

@ -227,7 +227,7 @@ bool ZONE_CONTAINER::UnFill()
} }
const wxPoint ZONE_CONTAINER::GetPosition() const wxPoint ZONE_CONTAINER::GetPosition() const
{ {
return (wxPoint) GetCornerPosition( 0 ); return (wxPoint) GetCornerPosition( 0 );
} }

View File

@ -85,7 +85,7 @@ public:
/** /**
* @return a wxPoint, position of the first point of the outline * @return a wxPoint, position of the first point of the outline
*/ */
const wxPoint GetPosition() const override; wxPoint GetPosition() const override;
void SetPosition( const wxPoint& aPos ) override {} void SetPosition( const wxPoint& aPos ) override {}
/** /**

View File

@ -62,7 +62,7 @@ public:
* Return the plot offset (usually the position * Return the plot offset (usually the position
* of the auxiliary axis * of the auxiliary axis
*/ */
const wxPoint GetOffset() { return m_offset; } wxPoint GetOffset() { return m_offset; }
/** /**
* *

View File

@ -179,7 +179,7 @@ public:
* Return the plot offset (usually the position * Return the plot offset (usually the position
* of the auxiliary axis * of the auxiliary axis
*/ */
const wxPoint GetOffset() { return m_offset; } wxPoint GetOffset() { return m_offset; }
/** /**
* Sets the page info used to plot drill maps * Sets the page info used to plot drill maps

View File

@ -103,7 +103,7 @@ public:
} }
#endif #endif
const wxPoint GetPosition() const override wxPoint GetPosition() const override
{ {
static wxPoint dummy(0, 0); static wxPoint dummy(0, 0);
return dummy; return dummy;