From f943635da829d798292af9af5cf94ceb90630922 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Feb 2024 19:37:16 +0100 Subject: [PATCH] Reuse wxXmlNode::GetNodeContent() in wxXmlResourceHandlerImpl Don't duplicate wxXmlNode function logic but just call it instead. This shouldn't result in any changes. --- src/xrc/xmlres.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 20ce5e75c8..b8d503caea 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -2262,18 +2262,7 @@ bool wxXmlResourceHandlerImpl::IsObjectNode(const wxXmlNode *node) const wxString wxXmlResourceHandlerImpl::GetNodeContent(const wxXmlNode *node) { - const wxXmlNode *n = node; - if (n == nullptr) return wxEmptyString; - n = n->GetChildren(); - - while (n) - { - if (n->GetType() == wxXML_TEXT_NODE || - n->GetType() == wxXML_CDATA_SECTION_NODE) - return n->GetContent(); - n = n->GetNext(); - } - return wxEmptyString; + return node ? node->GetNodeContent() : wxString{}; } wxXmlNode *wxXmlResourceHandlerImpl::GetNodeParent(const wxXmlNode *node) const