X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_WidgetAPI.cpp;h=e8dcbf4be98df31111a8965313a46475d6ffccff;hb=982481c856def9c064e5f2bb65de11a5b254da6e;hp=1249f9ab817ecd59e05b037d57a0390ad19caa40;hpb=2734393c7c19899fca7e7c36577b31317887a9c9;p=modules%2Fshaper.git diff --git a/src/Config/Config_WidgetAPI.cpp b/src/Config/Config_WidgetAPI.cpp index 1249f9ab8..e8dcbf4be 100644 --- a/src/Config/Config_WidgetAPI.cpp +++ b/src/Config/Config_WidgetAPI.cpp @@ -46,11 +46,18 @@ bool Config_WidgetAPI::toNextWidget() bool Config_WidgetAPI::toChildWidget() { if (myCurrentNode && hasChild(myCurrentNode)) { - myCurrentNode = myCurrentNode->children; - while (myCurrentNode && !isElementNode(myCurrentNode)) { - myCurrentNode = myCurrentNode->next; + xmlNodePtr aChildNode = myCurrentNode->children; + // it is possible that among child nodes, there is no an element node, so + // we should not change the current node until not-zero node is found + // otherwise, it may happens that the current node is null and the node tree information + // is lost + while (aChildNode && !isElementNode(aChildNode)) { + aChildNode = aChildNode->next; + } + if (aChildNode != NULL) { + myCurrentNode = aChildNode; + return true; } - return myCurrentNode != NULL; } return false; } @@ -74,7 +81,7 @@ std::string Config_WidgetAPI::widgetType() const bool Config_WidgetAPI::isGroupBoxWidget() const { - return isNode(myCurrentNode, WDG_GROUP, WDG_CHECK_GROUP, + return isNode(myCurrentNode, WDG_GROUP, WDG_OPTIONALBOX, NULL); }