From: Hosang Kim Date: Thu, 6 Jul 2023 06:03:41 +0000 (+0900) Subject: AurumXML: enhance speed of creating XPath and disable creating XPath X-Git-Tag: accepted/tizen/unified/20230713.014419~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F295366%2F2;p=platform%2Fcore%2Fuifw%2Faurum.git AurumXML: enhance speed of creating XPath and disable creating XPath partially. Change-Id: Ie740042a901322c75eb1e88568adb647998682a8 --- diff --git a/libaurum/src/AurumXML.cc b/libaurum/src/AurumXML.cc index 36dfa1b..a52764a 100644 --- a/libaurum/src/AurumXML.cc +++ b/libaurum/src/AurumXML.cc @@ -41,11 +41,8 @@ void AurumXML::traverse(xml_node& element, const std::shared_ptr { if (!node) return; - node->updateUniqueId(); node->updateName(); - node->updateRoleName(); node->updateAttributes(); - node->updateToolkitName(); std::string name; if (node->getType().empty()) @@ -164,11 +161,11 @@ std::shared_ptr AurumXML::checkParentNode(const std::shared_ptr< const auto parent = node->getParent(); if (!parent) return nullptr; - const std::string query = makeQuery(node->getId()); + const std::string query = makeQuery(parent->getId()); xml_node xmlNode = mDoc->select_node(query.c_str()).node(); if (xmlNode) { - auto children = node->getChildren(); + auto children = parent->getChildren(); for (const auto &child : children) { if (child->getRawHandler() == nullptr) continue; @@ -190,11 +187,15 @@ xml_node AurumXML::checkNode(const std::shared_ptr& node) xmlNode = mDoc->select_node(query.c_str()).node(); if (!xmlNode) { + /* When node is deleted, XMLDoc doesn't know it so XMLDoc is not updated. + * Disable creating XPath partially. // 1. find parent and check node again auto parent = checkParentNode(node); // 2. clear tree and create tree again - if (!parent) createXMLtree(); + if (!parent) + */ + createXMLtree(); xmlNode = mDoc->select_node(query.c_str()).node(); }