From cefa26b4976686e3e50fe6906f5be9cf946af27f Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 26 Apr 2025 23:03:02 +0300 Subject: [PATCH] minor refactor --- src/coders/xml.hpp | 4 ++-- src/graphics/ui/gui_xml.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coders/xml.hpp b/src/coders/xml.hpp index 5831c29a..f626dd34 100644 --- a/src/coders/xml.hpp +++ b/src/coders/xml.hpp @@ -53,11 +53,11 @@ namespace xml { /// @brief Get element tag const std::string& getTag() const; - inline bool isText() const { + bool isText() const { return getTag() == "#"; } - inline const std::string& text() const { + const std::string& getInnerText() const { return attr("#").getText(); } diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index b01e008e..2b0a9ab0 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -287,7 +287,7 @@ static std::wstring parse_inner_text( ) { std::wstring text = L""; if (element.size() == 1) { - std::string source = element.sub(0).attr("#").getText(); + std::string source = element.sub(0).getInnerText(); util::trim(source); text = util::str2wstr_utf8(source); if (text[0] == '@') { @@ -387,7 +387,7 @@ static std::shared_ptr read_button( std::shared_ptr