branchobj.cpp
changeset 98 58adc2d2ed08
parent 97 0b048b6bb6f4
child 100 f79a53ee8cf6
     1.1 --- a/branchobj.cpp	Thu Apr 21 19:14:38 2005 +0000
     1.2 +++ b/branchobj.cpp	Wed May 04 20:35:39 2005 +0000
     1.3 @@ -985,6 +985,25 @@
     1.4  	return bo;
     1.5  }
     1.6  
     1.7 +void BranchObj::removeBranchHere(BranchObj* borem)
     1.8 +{
     1.9 +	// This removes the branch bo from list, but 
    1.10 +	// inserts its childs at the place of bo
    1.11 +	BranchObj *bo;
    1.12 +	bo=borem->getLastBranch();
    1.13 +	while (bo)
    1.14 +	{
    1.15 +		bo->moveBranchTo (borem,1);
    1.16 +		bo=borem->getLastBranch();
    1.17 +	}	
    1.18 +	removeBranch (borem);
    1.19 +}
    1.20 +
    1.21 +void BranchObj::removeChilds()
    1.22 +{
    1.23 +	clear();
    1.24 +}
    1.25 +
    1.26  void BranchObj::removeBranch(BranchObj* bo)
    1.27  {
    1.28      // if bo is not in branch remove returns false, we
    1.29 @@ -1077,9 +1096,9 @@
    1.30  	else
    1.31  		return NULL;
    1.32  
    1.33 -	if (pos<0  || dst->getDepth()==1)
    1.34 +	if (pos<0||dst->getDepth()==0)
    1.35  	{	
    1.36 -		// links adds myself as last branch at dst
    1.37 +		// links myself as last branch at dst
    1.38  		dst->addBranchPtr (this);
    1.39  		return this;
    1.40  	} else