1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

refs #1080: Swap child/father in RemoveFromGroup method of NotesTool.

This commit is contained in:
snn
2020-04-14 12:57:18 +03:00
parent 4d31cb2021
commit 7c0ec2e214

View File

@@ -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;
}
}