Minor compiler warning and object improvements.

* Fix -Woverloaded-virtual warning in DIALOG_LIB_NEW_COMPONENT class
  definition.
* Make EDA_ITEM::Matches( const wxString& wxFindReplaceData& ) protected
  since it's a helper function that should only be called by derived objects.
This commit is contained in:
Alexander Golubev 2015-01-28 16:43:46 -05:00 committed by Wayne Stambaugh
parent ba6e2ffbcf
commit 3838082bf3
2 changed files with 19 additions and 17 deletions

View File

@ -1,8 +1,8 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2009-2105 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. * Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -40,7 +40,7 @@ public:
DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ); DIALOG_LIB_NEW_COMPONENT( wxWindow* parent );
void SetName( const wxString& name ) { m_textName->SetValue( name ); } void SetName( const wxString& name ) { m_textName->SetValue( name ); }
wxString GetName( void ) { return m_textName->GetValue(); } wxString GetName( void ) const { return m_textName->GetValue(); }
void SetReference( const wxString& reference ) void SetReference( const wxString& reference )
{ {

View File

@ -1,10 +1,10 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2008-2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2008-2013 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -426,17 +426,7 @@ public:
} }
/** /**
* Function Matches
* compares \a aText against search criteria in \a aSearchData.
* Helper function used in search and replace dialog * Helper function used in search and replace dialog
*
* @param aText A reference to a wxString object containing the string to test.
* @param aSearchData The criteria to search against.
* @return True if \a aText matches the search criteria in \a aSearchData.
*/
bool Matches( const wxString& aText, wxFindReplaceData& aSearchData );
/**
* Function Replace * Function Replace
* performs a text replace on \a aText using the find and replace criteria in * performs a text replace on \a aText using the find and replace criteria in
* \a aSearchData on items that support text find and replace. * \a aSearchData on items that support text find and replace.
@ -534,6 +524,18 @@ public:
static std::ostream& NestedSpace( int nestLevel, std::ostream& os ); static std::ostream& NestedSpace( int nestLevel, std::ostream& os );
#endif #endif
protected:
/**
* Function Matches
* compares \a aText against search criteria in \a aSearchData.
* This is a helper function for simplify derived class logic.
*
* @param aText A reference to a wxString object containing the string to test.
* @param aSearchData The criteria to search against.
* @return True if \a aText matches the search criteria in \a aSearchData.
*/
bool Matches( const wxString& aText, wxFindReplaceData& aSearchData );
}; };