From 63a40637ebe9f8944721fc448e46f979f4ebcdb4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 16 Feb 2024 14:24:40 +0100 Subject: [PATCH] Make wxXmlNode::GetDepth() parameter const There is no need to require a non-const pointer here. Closes #24317. --- include/wx/xml/xml.h | 2 +- interface/wx/xml/xml.h | 2 +- src/xml/xml.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/xml/xml.h b/include/wx/xml/xml.h index 67fe18bf7c..023337ce33 100644 --- a/include/wx/xml/xml.h +++ b/include/wx/xml/xml.h @@ -132,7 +132,7 @@ public: const wxString& GetContent() const { return m_content; } bool IsWhitespaceOnly() const; - int GetDepth(wxXmlNode *grandparent = nullptr) const; + int GetDepth(const wxXmlNode *grandparent = nullptr) const; // Gets node content from wxXML_ENTITY_NODE // The problem is, content is represented as diff --git a/interface/wx/xml/xml.h b/interface/wx/xml/xml.h index 6477391cc9..d2afbe3e5f 100644 --- a/interface/wx/xml/xml.h +++ b/interface/wx/xml/xml.h @@ -203,7 +203,7 @@ public: @a grandparent or the @NULL node (which is the parent of non-linked nodes or the parent of a wxXmlDocument's root element node). */ - int GetDepth(wxXmlNode* grandparent = nullptr) const; + int GetDepth(const wxXmlNode* grandparent = nullptr) const; /** Returns a flag indicating whether encoding conversion is necessary when saving. The default is @false. diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index bd1c64526b..d8e4ae5199 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -361,7 +361,7 @@ wxString wxXmlNode::GetNodeContent() const return wxEmptyString; } -int wxXmlNode::GetDepth(wxXmlNode *grandparent) const +int wxXmlNode::GetDepth(const wxXmlNode *grandparent) const { const wxXmlNode *n = this; int ret = -1;