From cda272fa395a9ac5075d61ff69585922eb2fe391 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 27 Jun 2018 17:16:43 +0300 Subject: [PATCH] Fix for the "case" attributes registration for the radio buttons. Make unit-tests working. --- src/Config/Config_Common.cpp | 8 +++++--- src/Config/Config_FeatureReader.cpp | 6 +++--- src/SketchPlugin/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Config/Config_Common.cpp b/src/Config/Config_Common.cpp index 544e7a7ea..c83a33079 100644 --- a/src/Config/Config_Common.cpp +++ b/src/Config/Config_Common.cpp @@ -68,7 +68,8 @@ bool isAttributeNode(xmlNodePtr theNode) // it's parent is "feature" or "source" or page ("case" or "box") if(!hasParent(theNode, NODE_FEATURE, NODE_SOURCE, WDG_GROUP, WDG_OPTIONALBOX, - WDG_TOOLBOX_BOX, WDG_SWITCH_CASE, NULL)) + WDG_TOOLBOX_BOX, WDG_RADIOBOX_ITEM, + WDG_SWITCH_CASE, NULL)) return false; //it should not be a "source" or a "validator" node @@ -86,7 +87,7 @@ bool isWidgetNode(xmlNodePtr theNode) return false; // it's parent is "feature" or "source" or a page ("box", "case") if(!hasParent(theNode, NODE_FEATURE, NODE_SOURCE, WDG_GROUP, WDG_OPTIONALBOX, - WDG_TOOLBOX_BOX, WDG_SWITCH_CASE, NULL)) + WDG_TOOLBOX_BOX, WDG_RADIOBOX_ITEM, WDG_SWITCH_CASE, NULL)) return false; //it should not be a "source" or a "validator" node @@ -99,7 +100,8 @@ bool isCaseNode(xmlNodePtr theNode) if(!isElementNode(theNode)) return false; - return isNode(theNode, WDG_OPTIONALBOX, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, NULL); + return isNode(theNode, WDG_OPTIONALBOX, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, + WDG_RADIOBOX_ITEM, NULL); } bool hasChild(xmlNodePtr theNode) diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index ffb5bc372..1bc35c4e9 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -91,7 +91,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) std::list > aCases; xmlNodePtr aCaseNode = - hasParentRecursive(theNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, NULL); + 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 = ""; @@ -116,7 +116,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) aCases.push_back(std::make_pair(aSwitchNodeID, aCaseNodeID)); aCaseNode = hasParentRecursive(aSwitchNode, WDG_SWITCH_CASE, - WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, NULL); + WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, WDG_RADIOBOX_ITEM, NULL); } aMessage->setCases(aCases); Events_Loop::loop()->send(aMessage); @@ -135,7 +135,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) void Config_FeatureReader::cleanup(xmlNodePtr theNode) { if (isNode(theNode, WDG_OPTIONALBOX, WDG_SWITCH, WDG_SWITCH_CASE, - WDG_TOOLBOX, WDG_TOOLBOX_BOX, NULL)) { + WDG_TOOLBOX, WDG_TOOLBOX_BOX, WDG_RADIOBOX_ITEM, WDG_RADIOBOX, NULL)) { // cleanup id of cases when leave case node cleanupAttribute(theNode, _ID); } diff --git a/src/SketchPlugin/CMakeLists.txt b/src/SketchPlugin/CMakeLists.txt index 47550e2d5..412c19605 100644 --- a/src/SketchPlugin/CMakeLists.txt +++ b/src/SketchPlugin/CMakeLists.txt @@ -235,7 +235,7 @@ ADD_UNIT_TESTS(TestSketchPointLine.py TestIntersectionWithLine.py TestIntersectionWithCircle.py TestIntersectionWithSpline.py - TestIntersectionChangeType.py + TestIntersectionChangeEdge.py Test2273.py Test2280.py Test2287.py -- 2.39.2