From: snn Date: Tue, 14 Apr 2020 09:57:18 +0000 (+0300) Subject: refs #1080: Swap child/father in RemoveFromGroup method of NotesTool. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=7c0ec2e2146660677992d9cdee4e93276e362bf9;p=occt-copy.git refs #1080: Swap child/father in RemoveFromGroup method of NotesTool. --- diff --git a/src/XCAFDoc/XCAFDoc_NotesTool.cxx b/src/XCAFDoc/XCAFDoc_NotesTool.cxx index 1cc1ef2926..96e8f0255b 100644 --- a/src/XCAFDoc/XCAFDoc_NotesTool.cxx +++ b/src/XCAFDoc/XCAFDoc_NotesTool.cxx @@ -600,16 +600,16 @@ XCAFDoc_NotesTool::RemoveFromGroup(const TDF_Label& theGroupLabel, if (!IsGroup(theGroupLabel)) return Standard_False; - Handle(XCAFDoc_GraphNode) aFather; - if (theGroupLabel.FindAttribute(XCAFDoc::NoteRefGUID(), aFather) && !aFather.IsNull()) + Handle(XCAFDoc_GraphNode) aChild; + if (theNoteLabel.FindAttribute(XCAFDoc::NoteRefGUID(), aChild) && !aChild.IsNull()) { - Standard_Integer nbChildren = aFather->NbChildren(); - for (Standard_Integer iChild = 1; iChild <= nbChildren; ++iChild) + Standard_Integer nbFathers = aChild->NbFathers(); + for (Standard_Integer iFather = 1; iFather <= nbFathers; ++iFather) { - Handle(XCAFDoc_GraphNode) aChild = aFather->GetChild(iChild); - if (!aChild.IsNull() && theNoteLabel.IsEqual(aChild->Label())) + Handle(XCAFDoc_GraphNode) aFather = aChild->GetFather(iFather); + if (!aFather.IsNull() && theGroupLabel.IsEqual(aFather->Label())) { - aFather->UnSetChild(aChild); + aChild->UnSetFather(aFather); return Standard_True; } }