mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024645: Pointer to the last is wrong for a tree node
Information on last child is added to the Dump() method + fixed a problem of lost last child tree node on removal (detach) operation. Test case for issue CR24645
This commit is contained in:
@@ -235,12 +235,7 @@ Standard_Boolean TDataStd_TreeNode::Remove ()
|
||||
}
|
||||
|
||||
if(Father()->HasLast()) {
|
||||
if (Handle(TDataStd_TreeNode)::DownCast(this) == Father()->Last()) {
|
||||
if(HasPrevious()) {
|
||||
Father()->SetLast(Previous());
|
||||
}
|
||||
else Father()->SetLast(bid);
|
||||
}
|
||||
Father()->SetLast(bid);
|
||||
}
|
||||
|
||||
SetFather(bid);
|
||||
@@ -698,6 +693,10 @@ Standard_OStream& TDataStd_TreeNode::Dump (Standard_OStream& anOS) const
|
||||
anOS<<" First=";
|
||||
if (!myFirst->Label().IsNull()) myFirst->Label().EntryDump(anOS);
|
||||
}
|
||||
if (myLast) {
|
||||
anOS<<" Last=";
|
||||
if (!myLast->Label().IsNull()) myLast->Label().EntryDump(anOS);
|
||||
}
|
||||
anOS<<endl;
|
||||
return anOS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user