From e626dcae257c61eb50939dd5669452deca478314 Mon Sep 17 00:00:00 2001 From: snn Date: Tue, 14 Apr 2020 12:57:18 +0300 Subject: [PATCH] refs #1080: Swap child/father in RemoveFromGroup method of NotesTool. --- src/XCAFDoc/XCAFDoc_NotesTool.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; } } -- 2.39.5