aboutsummaryrefslogtreecommitdiff
path: root/src/ui/mapper/CursorMapper.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-12-15 22:05:52 +0800
committerYuqian Yang <crupest@crupest.life>2025-12-15 22:05:52 +0800
commit6bbadfc6b1eaf14f68a27cb8e378f5e09ab38de6 (patch)
treedbfdb1ed836d8e9f2692ecd52b3f8576808cef1b /src/ui/mapper/CursorMapper.cpp
parentc77072d586bf7aca58e6465ceab3d11a0be0021f (diff)
downloadcru-6bbadfc6b1eaf14f68a27cb8e378f5e09ab38de6.tar.gz
cru-6bbadfc6b1eaf14f68a27cb8e378f5e09ab38de6.tar.bz2
cru-6bbadfc6b1eaf14f68a27cb8e378f5e09ab38de6.zip
Extract out MapFromXmlAsStringValue.HEADmain
Diffstat (limited to 'src/ui/mapper/CursorMapper.cpp')
-rw-r--r--src/ui/mapper/CursorMapper.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ui/mapper/CursorMapper.cpp b/src/ui/mapper/CursorMapper.cpp
index c7a8d4fc..00b94b91 100644
--- a/src/ui/mapper/CursorMapper.cpp
+++ b/src/ui/mapper/CursorMapper.cpp
@@ -19,13 +19,11 @@ std::shared_ptr<ICursor> CursorMapper::DoMapFromString(std::string str) {
} else if (cru::string::CaseInsensitiveCompare(str, "ibeam") == 0) {
return cursor_manager->GetSystemCursor(SystemCursorType::IBeam);
} else {
- throw Exception("Unsupported cursor type.");
+ throw MapException("Unknown cursor name.");
}
}
std::shared_ptr<ICursor> CursorMapper::DoMapFromXml(xml::XmlElementNode* node) {
- auto value_attr = node->GetOptionalAttributeValueCaseInsensitive("value");
- if (!value_attr) return nullptr;
- return DoMapFromString(*value_attr);
+ return MapFromXmlAsStringValue(node, nullptr);
}
} // namespace cru::ui::mapper