From: vro Date: Thu, 27 Feb 2014 14:43:38 +0000 (+0400) Subject: 0024645: Pointer to the last is wrong for a tree node X-Git-Tag: V6_8_0_beta~521 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=bf5b5293464a0a7e0f93e96f94df00dbeac70ae0;p=occt-copy.git 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 --- diff --git a/src/TDataStd/TDataStd_TreeNode.cxx b/src/TDataStd/TDataStd_TreeNode.cxx index 1b0b66437f..de47e20c29 100644 --- a/src/TDataStd/TDataStd_TreeNode.cxx +++ b/src/TDataStd/TDataStd_TreeNode.cxx @@ -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<