From 8ec22772d0857bc5fe113ec622ec02be75ffd002 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 Oct 2010 14:23:56 +0000 Subject: [PATCH] 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 --- include/wx/xrc/xmlres.h | 2 +- src/xrc/xmlres.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index bee65df5a4..aba488cd0f 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -485,7 +485,7 @@ protected: // Returns true if the node has a property class equal to classname, // e.g. . - 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, content is represented as diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index ba4a986bb3..4aeeb37a11 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -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; } -- 2.45.2