X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FConfig%2FConfig_WidgetAPI.cpp;h=2b74277a142da5059e4024e55dd9a29efb774165;hb=61a55a09650c0e6e68a5ebf786c51664ed2a9001;hp=994a46f99c9a300205331c5c5d1c85389e964535;hpb=38afbd899a8645c83e17f2c24a17a2b7414911b4;p=modules%2Fshaper.git diff --git a/src/Config/Config_WidgetAPI.cpp b/src/Config/Config_WidgetAPI.cpp index 994a46f99..2b74277a1 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 (!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 true; } return false; } @@ -72,16 +79,16 @@ std::string Config_WidgetAPI::widgetType() const return result; } -bool Config_WidgetAPI::isContainerWidget() const +bool Config_WidgetAPI::isGroupBoxWidget() const { return isNode(myCurrentNode, WDG_GROUP, WDG_CHECK_GROUP, - NULL); + NULL); } bool Config_WidgetAPI::isPagedWidget() const { return isNode(myCurrentNode, WDG_TOOLBOX, WDG_SWITCH, - NULL); + NULL); } std::string Config_WidgetAPI::getProperty(const char* thePropName) const