aboutsummaryrefslogtreecommitdiff
path: root/src/ui/mapper/CursorMapper.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-23 21:07:03 +0800
committercrupest <crupest@outlook.com>2022-01-23 21:07:03 +0800
commitda9bdf2baced1ff51350c98047b7ade68fcae930 (patch)
treec51b9c8538c82b19d142eb1340e6dac0e88ff4e4 /src/ui/mapper/CursorMapper.cpp
parent13860c88910c00478abe3001cc80125e76767381 (diff)
downloadcru-da9bdf2baced1ff51350c98047b7ade68fcae930.tar.gz
cru-da9bdf2baced1ff51350c98047b7ade68fcae930.tar.bz2
cru-da9bdf2baced1ff51350c98047b7ade68fcae930.zip
...
Diffstat (limited to 'src/ui/mapper/CursorMapper.cpp')
-rw-r--r--src/ui/mapper/CursorMapper.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/mapper/CursorMapper.cpp b/src/ui/mapper/CursorMapper.cpp
index d77da2a5..ad9c2bbf 100644
--- a/src/ui/mapper/CursorMapper.cpp
+++ b/src/ui/mapper/CursorMapper.cpp
@@ -9,7 +9,7 @@ using cru::platform::gui::ICursor;
using cru::platform::gui::SystemCursorType;
bool CursorMapper::XmlElementIsOfThisType(xml::XmlElementNode *node) {
- return node->GetTag() == u"Cursor";
+ return node->GetTag().CaseInsensitiveCompare(u"Cursor") == 0;
}
std::shared_ptr<ICursor> CursorMapper::DoMapFromString(String str) {
@@ -17,11 +17,11 @@ std::shared_ptr<ICursor> CursorMapper::DoMapFromString(String str) {
auto cursor_manager = GetUiApplication()->GetCursorManager();
- if (str == u"arrow") {
+ if (str.CaseInsensitiveCompare(u"arrow") == 0) {
return cursor_manager->GetSystemCursor(SystemCursorType::Arrow);
- } else if (str == u"hand") {
+ } else if (str.CaseInsensitiveCompare(u"hand") == 0) {
return cursor_manager->GetSystemCursor(SystemCursorType::Hand);
- } else if (str == u"ibeam") {
+ } else if (str.CaseInsensitiveCompare(u"ibeam") == 0) {
return cursor_manager->GetSystemCursor(SystemCursorType::IBeam);
} else {
throw Exception(u"Unsupported cursor type.");
@@ -29,7 +29,7 @@ std::shared_ptr<ICursor> CursorMapper::DoMapFromString(String str) {
}
std::shared_ptr<ICursor> CursorMapper::DoMapFromXml(xml::XmlElementNode *node) {
- auto value_attr = node->GetOptionalAttribute(u"value");
+ auto value_attr = node->GetOptionalAttributeCaseInsensitive(u"value");
if (!value_attr) return nullptr;
return DoMapFromString(*value_attr);
}