- aMessage->setConcealment(getBooleanAttribute(theNode, ATTR_CONCEALMENT, false));
- // nested "paged" widgets are not allowed, this issue may be resolved here:
- if (hasParentRecursive(theNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, NULL)) {
- const char* kWdgCase = hasParentRecursive(theNode, WDG_SWITCH_CASE, NULL)
- ? WDG_SWITCH_CASE
- : WDG_TOOLBOX_BOX;
- const char* kWdgSwitch = hasParentRecursive(theNode, WDG_SWITCH_CASE, NULL)
- ? WDG_SWITCH
- : WDG_TOOLBOX;
- aMessage->setCaseId(restoreAttribute(kWdgCase, _ID));
- aMessage->setSwitchId(restoreAttribute(kWdgSwitch, _ID));
+ bool isConcealment = getBooleanAttribute(theNode, ATTR_CONCEALMENT, false);
+ aMessage->setConcealment(isConcealment);
+ bool isMainArg = isConcealment && getBooleanAttribute(theNode, ATTR_MAIN_ARG, false);
+ aMessage->setMainArgument(isMainArg);
+ aMessage->setGeometricalSelection(getBooleanAttribute(theNode,
+ ATTR_GEOMETRICAL_SELECTION,
+ false));
+
+ std::list<std::pair<std::string, std::string> > aCases;
+ xmlNodePtr aCaseNode = hasParentRecursive(theNode,
+ WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, WDG_RADIOBOX_ITEM, NULL);
+ while(aCaseNode) {
+ std::string aCaseNodeID = getProperty(aCaseNode, _ID);
+ std::string aSwitchNodeID = "";
+ const xmlChar* aName = aCaseNode->name;
+ xmlNodePtr aSwitchNode = 0;
+ if (!xmlStrcmp(aName, (const xmlChar *) WDG_SWITCH_CASE)) {
+ aSwitchNode = hasParentRecursive(aCaseNode, WDG_SWITCH, NULL);
+ }
+ else if (!xmlStrcmp(aName, (const xmlChar *) WDG_TOOLBOX_BOX)) {
+ aSwitchNode = hasParentRecursive(aCaseNode, WDG_TOOLBOX, NULL);
+ }
+ else if (!xmlStrcmp(aName, (const xmlChar *)WDG_RADIOBOX_ITEM)) {
+ aSwitchNode = hasParentRecursive(aCaseNode, WDG_RADIOBOX, NULL);
+ }
+ if (!xmlStrcmp(aName, (const xmlChar *) WDG_OPTIONALBOX)) {
+ /// the box is optional, attribute is in case
+ /// if the optional attribute value is not empty
+ aSwitchNode = aCaseNode;
+ }
+ if (aSwitchNode)
+ aSwitchNodeID = getProperty(aSwitchNode, _ID);
+
+ aCases.push_back(std::make_pair(aSwitchNodeID, aCaseNodeID));
+ aCaseNode = hasParentRecursive(aSwitchNode, WDG_SWITCH_CASE,
+ WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, WDG_RADIOBOX_ITEM, NULL);