Make wxFindReplaceData argument const
This commit is contained in:
parent
bb2881a5ab
commit
ec0af24f13
|
@ -129,7 +129,7 @@ wxString EDA_ITEM::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool EDA_ITEM::Matches( const wxString& aText, wxFindReplaceData& aSearchData )
|
bool EDA_ITEM::Matches( const wxString& aText, const wxFindReplaceData& aSearchData ) const
|
||||||
{
|
{
|
||||||
wxString text = aText;
|
wxString text = aText;
|
||||||
wxString searchText = aSearchData.GetFindString();
|
wxString searchText = aSearchData.GetFindString();
|
||||||
|
@ -156,7 +156,7 @@ bool EDA_ITEM::Matches( const wxString& aText, wxFindReplaceData& aSearchData )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool EDA_ITEM::Replace( wxFindReplaceData& aSearchData, wxString& aText )
|
bool EDA_ITEM::Replace( const wxFindReplaceData& aSearchData, wxString& aText )
|
||||||
{
|
{
|
||||||
wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
|
wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ int EDA_TEXT::GetEffectiveTextPenWidth( int aDefaultWidth ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool EDA_TEXT::Replace( wxFindReplaceData& aSearchData )
|
bool EDA_TEXT::Replace( const wxFindReplaceData& aSearchData )
|
||||||
{
|
{
|
||||||
bool retval = EDA_ITEM::Replace( aSearchData, m_text );
|
bool retval = EDA_ITEM::Replace( aSearchData, m_text );
|
||||||
m_shown_text = UnescapeString( m_text );
|
m_shown_text = UnescapeString( m_text );
|
||||||
|
|
|
@ -1478,7 +1478,7 @@ void SCH_COMPONENT::Rotate( wxPoint aPosition )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_COMPONENT::Matches( wxFindReplaceData& aSearchData, void* aAuxData )
|
bool SCH_COMPONENT::Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const
|
||||||
{
|
{
|
||||||
wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( EDA_UNITS::MILLIMETRES ) );
|
wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( EDA_UNITS::MILLIMETRES ) );
|
||||||
|
|
||||||
|
|
|
@ -592,7 +592,7 @@ public:
|
||||||
void MirrorX( int aXaxis_position ) override;
|
void MirrorX( int aXaxis_position ) override;
|
||||||
void Rotate( wxPoint aPosition ) override;
|
void Rotate( wxPoint aPosition ) override;
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override;
|
||||||
|
|
||||||
void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override;
|
void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override;
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,7 @@ bool SCH_FIELD::IsVoid() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_FIELD::Matches( wxFindReplaceData& aSearchData, void* aAuxData )
|
bool SCH_FIELD::Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const
|
||||||
{
|
{
|
||||||
wxString text = GetShownText();
|
wxString text = GetShownText();
|
||||||
int flags = aSearchData.GetFlags();
|
int flags = aSearchData.GetFlags();
|
||||||
|
@ -391,7 +391,7 @@ bool SCH_FIELD::IsReplaceable() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_FIELD::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
|
bool SCH_FIELD::Replace( const wxFindReplaceData& aSearchData, void* aAuxData )
|
||||||
{
|
{
|
||||||
bool isReplaced = false;
|
bool isReplaced = false;
|
||||||
|
|
||||||
|
|
|
@ -181,9 +181,9 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override;
|
||||||
|
|
||||||
bool Replace( wxFindReplaceData& aSearchData, void* aAuxData = NULL ) override;
|
bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData = NULL ) override;
|
||||||
|
|
||||||
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
|
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ void SCH_MARKER::Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_MARKER::Matches( wxFindReplaceData& aSearchData, void* aAuxData )
|
bool SCH_MARKER::Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const
|
||||||
{
|
{
|
||||||
return SCH_ITEM::Matches( m_rcItem->GetErrorMessage(), aSearchData );
|
return SCH_ITEM::Matches( m_rcItem->GetErrorMessage(), aSearchData );
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ public:
|
||||||
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
|
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
|
||||||
* @return True if the DRC main or auxiliary text matches the search criteria.
|
* @return True if the DRC main or auxiliary text matches the search criteria.
|
||||||
*/
|
*/
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxDat ) override;
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxDat ) const override;
|
||||||
|
|
||||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ int SCH_PIN::GetLength() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PIN::Matches( wxFindReplaceData& aSearchData, void* aAuxDat )
|
bool SCH_PIN::Matches( const wxFindReplaceData& aSearchData, void* aAuxDat ) const
|
||||||
{
|
{
|
||||||
if( !( aSearchData.GetFlags() & FR_SEARCH_ALL_PINS ) )
|
if( !( aSearchData.GetFlags() & FR_SEARCH_ALL_PINS ) )
|
||||||
return false;
|
return false;
|
||||||
|
@ -125,7 +125,7 @@ bool SCH_PIN::Matches( wxFindReplaceData& aSearchData, void* aAuxDat )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PIN::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
|
bool SCH_PIN::Replace( const wxFindReplaceData& aSearchData, void* aAuxData )
|
||||||
{
|
{
|
||||||
bool isReplaced = false;
|
bool isReplaced = false;
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,9 @@ public:
|
||||||
/// Returns the pin's position in global coordinates
|
/// Returns the pin's position in global coordinates
|
||||||
wxPoint GetTransformedPosition() const;
|
wxPoint GetTransformedPosition() const;
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override;
|
||||||
|
|
||||||
bool Replace( wxFindReplaceData& aSearchData, void* aAuxData ) override;
|
bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData ) override;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* While many of these are currently simply covers for the equivalent LIB_PIN methods,
|
* While many of these are currently simply covers for the equivalent LIB_PIN methods,
|
||||||
|
|
|
@ -789,7 +789,7 @@ void SCH_SHEET::Resize( const wxSize& aSize )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_SHEET::Matches( wxFindReplaceData& aSearchData, void* aAuxData )
|
bool SCH_SHEET::Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const
|
||||||
{
|
{
|
||||||
wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( EDA_UNITS::MILLIMETRES ) );
|
wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( EDA_UNITS::MILLIMETRES ) );
|
||||||
|
|
||||||
|
|
|
@ -183,12 +183,12 @@ public:
|
||||||
void MirrorY( int aYaxis_position ) override;
|
void MirrorY( int aYaxis_position ) override;
|
||||||
void Rotate( wxPoint aPosition ) override;
|
void Rotate( wxPoint aPosition ) override;
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
|
||||||
{
|
{
|
||||||
return SCH_ITEM::Matches( GetText(), aSearchData );
|
return SCH_ITEM::Matches( GetText(), aSearchData );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Replace( wxFindReplaceData& aSearchData, void* aAuxData = NULL ) override
|
bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData = NULL ) override
|
||||||
{
|
{
|
||||||
return EDA_TEXT::Replace( aSearchData );
|
return EDA_TEXT::Replace( aSearchData );
|
||||||
}
|
}
|
||||||
|
@ -525,7 +525,7 @@ public:
|
||||||
void MirrorX( int aXaxis_position ) override;
|
void MirrorX( int aXaxis_position ) override;
|
||||||
void Rotate( wxPoint aPosition ) override;
|
void Rotate( wxPoint aPosition ) override;
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override;
|
||||||
|
|
||||||
bool IsReplaceable() const override { return true; }
|
bool IsReplaceable() const override { return true; }
|
||||||
|
|
||||||
|
|
|
@ -283,12 +283,12 @@ public:
|
||||||
virtual void Rotate90( bool aClockwise );
|
virtual void Rotate90( bool aClockwise );
|
||||||
virtual void MirrorSpinStyle( bool aLeftRight );
|
virtual void MirrorSpinStyle( bool aLeftRight );
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
|
||||||
{
|
{
|
||||||
return SCH_ITEM::Matches( GetText(), aSearchData );
|
return SCH_ITEM::Matches( GetText(), aSearchData );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Replace( wxFindReplaceData& aSearchData, void* aAuxData ) override
|
bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData ) override
|
||||||
{
|
{
|
||||||
return EDA_TEXT::Replace( aSearchData );
|
return EDA_TEXT::Replace( aSearchData );
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,7 +410,7 @@ public:
|
||||||
* @param aAuxData A pointer to optional data required for the search or NULL if not used.
|
* @param aAuxData A pointer to optional data required for the search or NULL if not used.
|
||||||
* @return True if the item's text matches the search criteria in \a aSearchData.
|
* @return True if the item's text matches the search criteria in \a aSearchData.
|
||||||
*/
|
*/
|
||||||
virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData )
|
virtual bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ public:
|
||||||
* @param aText A reference to a wxString object containing the text to be replaced.
|
* @param aText A reference to a wxString object containing the text to be replaced.
|
||||||
* @return True if \a aText was modified, otherwise false.
|
* @return True if \a aText was modified, otherwise false.
|
||||||
*/
|
*/
|
||||||
static bool Replace( wxFindReplaceData& aSearchData, wxString& aText );
|
static bool Replace( const wxFindReplaceData& aSearchData, wxString& aText );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a text replace using the find and replace criteria in \a aSearchData
|
* Perform a text replace using the find and replace criteria in \a aSearchData
|
||||||
|
@ -437,7 +437,7 @@ public:
|
||||||
* @param aAuxData A pointer to optional data required for the search or NULL if not used.
|
* @param aAuxData A pointer to optional data required for the search or NULL if not used.
|
||||||
* @return True if the item text was modified, otherwise false.
|
* @return True if the item text was modified, otherwise false.
|
||||||
*/
|
*/
|
||||||
virtual bool Replace( wxFindReplaceData& aSearchData, void* aAuxData = nullptr )
|
virtual bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData = nullptr )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -517,7 +517,7 @@ protected:
|
||||||
* @param aSearchData The criteria to search against.
|
* @param aSearchData The criteria to search against.
|
||||||
* @return True if \a aText matches the search criteria in \a aSearchData.
|
* @return True if \a aText matches the search criteria in \a aSearchData.
|
||||||
*/
|
*/
|
||||||
bool Matches( const wxString& aText, wxFindReplaceData& aSearchData );
|
bool Matches( const wxString& aText, const wxFindReplaceData& aSearchData ) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const KIID m_Uuid;
|
const KIID m_Uuid;
|
||||||
|
|
|
@ -237,7 +237,7 @@ public:
|
||||||
* search and replace criteria.
|
* search and replace criteria.
|
||||||
* @return True if the text item was modified, otherwise false.
|
* @return True if the text item was modified, otherwise false.
|
||||||
*/
|
*/
|
||||||
bool Replace( wxFindReplaceData& aSearchData );
|
bool Replace( const wxFindReplaceData& aSearchData );
|
||||||
|
|
||||||
bool IsDefaultFormatting() const;
|
bool IsDefaultFormatting() const;
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
|
||||||
{
|
{
|
||||||
return BOARD_ITEM::Matches( GetShownText(), aSearchData );
|
return BOARD_ITEM::Matches( GetShownText(), aSearchData );
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ public:
|
||||||
|
|
||||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
|
||||||
{
|
{
|
||||||
return BOARD_ITEM::Matches( m_rcItem->GetErrorMessage(), aSearchData );
|
return BOARD_ITEM::Matches( m_rcItem->GetErrorMessage(), aSearchData );
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
|
|
||||||
wxString GetShownText( int aDepth = 0 ) const override;
|
wxString GetShownText( int aDepth = 0 ) const override;
|
||||||
|
|
||||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
|
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
|
||||||
{
|
{
|
||||||
return BOARD_ITEM::Matches( GetShownText(), aSearchData );
|
return BOARD_ITEM::Matches( GetShownText(), aSearchData );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue