Make wxXmlResourceHandler::IsOfClass() static.

This simple helper function doesn't use any wxXmlResourceHandler data as it's
just a trivial wrapper for wxXmlNode::GetAttribute().

Making it static allows, in particular, to call it from const member functions
of wxXmlResourceHandler-derived classes (making it "const" itself would
achieve this too, of course, but it just doesn't need to be non-static).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-10-24 14:23:56 +00:00
parent 9b307a69b3
commit 8ec22772d0
2 changed files with 3 additions and 2 deletions

View File

@ -485,7 +485,7 @@ protected:
// Returns true if the node has a property class equal to classname,
// e.g. <object class="wxDialog">.
bool IsOfClass(wxXmlNode *node, const wxString& classname);
static bool IsOfClass(wxXmlNode *node, const wxString& classname);
// Gets node content from wxXML_ENTITY_NODE
// The problem is, <tag>content<tag> is represented as

View File

@ -1555,9 +1555,10 @@ wxXmlNode *wxXmlResourceHandler::GetParamNode(const wxString& param)
return NULL;
}
/* static */
bool wxXmlResourceHandler::IsOfClass(wxXmlNode *node, const wxString& classname)
{
return node->GetAttribute(wxT("class"), wxEmptyString) == classname;
return node->GetAttribute(wxT("class")) == classname;
}