summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorthat <github@that.at>2015-11-04 21:46:01 +0100
committerDees Troy <dees_troy@teamw.in>2015-11-05 19:52:46 +0100
commit54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825 (patch)
tree7ff07267650e18775d445e66ba63afd38fea6439 /gui
parentgui: fix initial state of checkboxes in listbox (diff)
downloadandroid_bootable_recovery-54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825.tar
android_bootable_recovery-54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825.tar.gz
android_bootable_recovery-54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825.tar.bz2
android_bootable_recovery-54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825.tar.lz
android_bootable_recovery-54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825.tar.xz
android_bootable_recovery-54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825.tar.zst
android_bootable_recovery-54e9c839bcafe52fc16fa7fc6c1eefcdf1f8e825.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/pages.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 3abd28785..0a1de96f3 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -137,20 +137,20 @@ xml_node<>* FindNode(xml_node<>* parent, const char* nodename, int depth /* = 0
style = style->next_sibling("style");
}
} else {
- // Search for stylename in the parent node <object type="foo" stylename="foo2">
+ // Search for stylename in the parent node <object type="foo" style="foo2">
xml_attribute<>* attr = parent->first_attribute("style");
// If no style is found anywhere else and the node wasn't found in the object itself
// as a special case we will search for a style that uses the same style name as the
// object type, so <object type="button"> would search for a style named "button"
if (!attr)
attr = parent->first_attribute("type");
- if (attr) {
- xml_node<>* node = PageManager::FindStyle(attr->value());
- if (node) {
- xml_node<>* stylenode = FindNode(node, nodename, depth + 1);
- if (stylenode)
- return stylenode;
- }
+ // if there's no attribute type, the object type must be the element name
+ std::string stylename = attr ? attr->value() : parent->name();
+ xml_node<>* node = PageManager::FindStyle(stylename);
+ if (node) {
+ xml_node<>* stylenode = FindNode(node, nodename, depth + 1);
+ if (stylenode)
+ return stylenode;
}
}
return NULL;