diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-10-17 08:37:30 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-10-17 08:37:30 +0800 |
commit | 3c8d5c8f732239a8b50418be27464e30b9dddeae (patch) | |
tree | 8ffb46c18e48c8463c1fb16fcacf216f296b8a1f /src/ui/ThemeResourceDictionary.cpp | |
parent | 37943858b3b260589b5dc222bb5184d2846fb6dc (diff) | |
download | cru-3c8d5c8f732239a8b50418be27464e30b9dddeae.tar.gz cru-3c8d5c8f732239a8b50418be27464e30b9dddeae.tar.bz2 cru-3c8d5c8f732239a8b50418be27464e30b9dddeae.zip |
Exception remove string.
Diffstat (limited to 'src/ui/ThemeResourceDictionary.cpp')
-rw-r--r-- | src/ui/ThemeResourceDictionary.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/ThemeResourceDictionary.cpp b/src/ui/ThemeResourceDictionary.cpp index 421723f5..4bf3d691 100644 --- a/src/ui/ThemeResourceDictionary.cpp +++ b/src/ui/ThemeResourceDictionary.cpp @@ -10,7 +10,7 @@ std::unique_ptr<ThemeResourceDictionary> ThemeResourceDictionary::FromFile( const String& file_path) { io::CFileStream stream(file_path.ToUtf8().c_str(), "r"); auto xml_string = stream.ReadToEndAsUtf8String(); - auto parser = xml::XmlParser(xml_string); + auto parser = xml::XmlParser(String::FromUtf8(xml_string)); return std::make_unique<ThemeResourceDictionary>(parser.Parse(), false); } @@ -25,7 +25,7 @@ ThemeResourceDictionary::~ThemeResourceDictionary() = default; void ThemeResourceDictionary::UpdateResourceMap(xml::XmlElementNode* xml_root) { if (!xml_root->GetTag().CaseInsensitiveEqual(u"Theme")) { - throw Exception(u"Root tag of theme must be 'Theme'."); + throw Exception("Root tag of theme must be 'Theme'."); } for (auto child : xml_root->GetChildren()) { @@ -34,10 +34,10 @@ void ThemeResourceDictionary::UpdateResourceMap(xml::XmlElementNode* xml_root) { if (c->GetTag().CaseInsensitiveEqual(u"Resource")) { auto key_attr = c->GetOptionalAttributeValueCaseInsensitive(u"key"); if (!key_attr) { - throw Exception(u"'key' attribute is required for resource."); + throw Exception("'key' attribute is required for resource."); } if (c->GetChildElementCount() != 1) { - throw Exception(u"Resource must have only one child element."); + throw Exception("Resource must have only one child element."); } ResourceEntry entry; |