]> OCCT Git - occt-copy.git/commitdiff
0030988: Add possibility to attach multiple files to notes
authorsnn <snn@opencascade.com>
Tue, 14 Apr 2020 09:57:18 +0000 (12:57 +0300)
committernds <natalia.ermolaeva@opencascade.com>
Sat, 16 May 2020 09:11:33 +0000 (12:11 +0300)
- Swap child/father in RemoveFromGroup method of NotesTool.

(cherry picked from commit 7c0ec2e2146660677992d9cdee4e93276e362bf9)

src/XCAFDoc/XCAFDoc_NotesTool.cxx

index 6feffdae96f1f2556c3cbdbaba5a3acd61d926eb..b6c6532ab1a04f94f827a16297cbb732c94cc76f 100644 (file)
@@ -601,16 +601,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;
       }
     }