From 4de3a1a99e1fe2fb10d145a7fe14b50757d22ef0 Mon Sep 17 00:00:00 2001 From: tritao Date: Wed, 22 Jan 2025 22:13:13 +0000 Subject: [PATCH] Gui: Use `SO_SWITCH_NONE` instead of -1. --- src/Gui/ViewProviderLink.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Gui/ViewProviderLink.cpp b/src/Gui/ViewProviderLink.cpp index 0d749b9379..63857efd54 100644 --- a/src/Gui/ViewProviderLink.cpp +++ b/src/Gui/ViewProviderLink.cpp @@ -283,7 +283,7 @@ public: continue; int count = pcSwitches[i]->getNumChildren(); if((index<0 && i==LinkView::SnapshotChild) || !count) - pcSwitches[i]->whichChild = -1; + pcSwitches[i]->whichChild = SO_SWITCH_NONE; else if(count>pcLinked->getDefaultMode()) pcSwitches[i]->whichChild = pcLinked->getDefaultMode(); else @@ -330,7 +330,7 @@ public: for(int idx : indices) { if(!pcSwitches[idx]) continue; - if(pcSwitches[idx]->whichChild.getValue()==-1) + if(pcSwitches[idx]->whichChild.getValue()==SO_SWITCH_NONE) return false; } return true; @@ -344,7 +344,7 @@ public: if(!pcSwitches[idx]) continue; if(!visible) - pcSwitches[idx]->whichChild = -1; + pcSwitches[idx]->whichChild = SO_SWITCH_NONE; else if(pcSwitches[idx]->getNumChildren()>pcLinked->getDefaultMode()) pcSwitches[idx]->whichChild = pcLinked->getDefaultMode(); } @@ -385,7 +385,7 @@ public: pcLinkedSwitch.reset(); coinRemoveAllChildren(pcSnapshot); - pcModeSwitch->whichChild = -1; + pcModeSwitch->whichChild = SO_SWITCH_NONE; coinRemoveAllChildren(pcModeSwitch); SoSwitch *pcUpdateSwitch = pcModeSwitch; @@ -1138,7 +1138,7 @@ void LinkView::setChildren(const std::vector &children, auto &info = *nodeArray[i]; info.isGroup = false; info.groupIndex = -1; - info.pcSwitch->whichChild = (vis.size()<=i||vis[i])?0:-1; + info.pcSwitch->whichChild = (vis.size()<=i||vis[i])?0:SO_SWITCH_NONE; info.link(obj); if(obj->hasExtension(App::GroupExtension::getExtensionClassTypeId(),false)) { info.isGroup = true; @@ -1189,7 +1189,7 @@ void LinkView::setTransform(int index, const Base::Matrix4D &mat) { void LinkView::setElementVisible(int idx, bool visible) { if(idx>=0 && idx<(int)nodeArray.size()) - nodeArray[idx]->pcSwitch->whichChild = visible?0:-1; + nodeArray[idx]->pcSwitch->whichChild = visible?0:SO_SWITCH_NONE; } bool LinkView::isElementVisible(int idx) const {