1
0
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:
vro
2014-02-27 18:43:38 +04:00
committed by apn
parent 49663e13f0
commit bf5b529346
2 changed files with 50 additions and 6 deletions

View File

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