| 17 | |
| 18 | |
| 19 | RichWidget::RichWidget(WidgetPtr parent, const ElementPtr &element) |
| 20 | : Widget(std::move(parent), element) { |
| 21 | uintptr_t hashcode1 = std::hash<std::string>{}(this->_clazz); |
| 22 | uintptr_t hashcode2 = std::hash<std::string>{}(this->_resourceID); |
| 23 | uintptr_t hashcode3 = 0x1; |
| 24 | for (int i: this->getActions()) { |
| 25 | hashcode3 ^= (127U * std::hash<int>{}(i)); |
| 26 | } |
| 27 | this->_widgetHashcode = ((hashcode1 ^ (hashcode2 << 4)) >> 2) ^ ((127U * hashcode3 << 1)); |
| 28 | std::string elementText = this->getValidTextFromWidgetAndChildren(element); |
| 29 | if (!elementText.empty()) |
| 30 | this->_widgetHashcode ^= (0x79b9 + (std::hash<std::string>{}(elementText) << 1)); |
| 31 | |
| 32 | } |
| 33 | |
| 34 | std::string RichWidget::getValidTextFromWidgetAndChildren(const ElementPtr &element) const { |
| 35 | std::string txt = element->validText; |
nothing calls this directly
no test coverage detected