Make wxXmlResourceHandlerImpl::GetNodeContent() const

There doesn't seem to be any reason not to and it's more consistent with
the other similar functions.
This commit is contained in:
Vadim Zeitlin 2024-02-03 19:45:27 +01:00
parent f943635da8
commit 9ab62c02fd
4 changed files with 5 additions and 5 deletions

View file

@ -512,7 +512,7 @@ public:
// wxXML_ENTITY_NODE name="tag", content=""
// |-- wxXML_TEXT_NODE or
// wxXML_CDATA_SECTION_NODE name="" content="content"
wxString GetNodeContent(const wxXmlNode *node) override;
wxString GetNodeContent(const wxXmlNode *node) const override;
wxXmlNode *GetNodeParent(const wxXmlNode *node) const override;
wxXmlNode *GetNodeNext(const wxXmlNode *node) const override;

View file

@ -61,7 +61,7 @@ public:
wxObject *instance) = 0;
virtual bool IsOfClass(wxXmlNode *node, const wxString& classname) const = 0;
virtual bool IsObjectNode(const wxXmlNode *node) const = 0;
virtual wxString GetNodeContent(const wxXmlNode *node) = 0;
virtual wxString GetNodeContent(const wxXmlNode *node) const = 0;
virtual wxXmlNode *GetNodeParent(const wxXmlNode *node) const = 0;
virtual wxXmlNode *GetNodeNext(const wxXmlNode *node) const = 0;
virtual wxXmlNode *GetNodeChildren(const wxXmlNode *node) const = 0;
@ -240,7 +240,7 @@ protected:
{
return GetImpl()->IsObjectNode(node);
}
wxString GetNodeContent(const wxXmlNode *node)
wxString GetNodeContent(const wxXmlNode *node) const
{
return GetImpl()->GetNodeContent(node);
}

View file

@ -763,7 +763,7 @@ protected:
/**
Gets node content from wxXML_ENTITY_NODE.
*/
wxString GetNodeContent(wxXmlNode* node);
wxString GetNodeContent(wxXmlNode* node) const;
/**
Gets the parent of the node given.

View file

@ -2260,7 +2260,7 @@ bool wxXmlResourceHandlerImpl::IsObjectNode(const wxXmlNode *node) const
node->GetName() == wxS("object_ref"));
}
wxString wxXmlResourceHandlerImpl::GetNodeContent(const wxXmlNode *node)
wxString wxXmlResourceHandlerImpl::GetNodeContent(const wxXmlNode *node) const
{
return node ? node->GetNodeContent() : wxString{};
}