branchobj.cpp
branchqt4-port
changeset 17 557239819c45
parent 7 84f76a3876d7
child 18 70c41284cb48
     1.1 --- a/branchobj.cpp	Tue Aug 29 08:31:42 2006 +0000
     1.2 +++ b/branchobj.cpp	Wed Aug 30 12:16:25 2006 +0000
     1.3 @@ -14,6 +14,7 @@
     1.4  /////////////////////////////////////////////////////////////////
     1.5  
     1.6  BranchObj* BranchObj::itLast=NULL;
     1.7 +BranchObj* BranchObj::itFirst=NULL;
     1.8  
     1.9  
    1.10  BranchObj::BranchObj () :OrnamentedObj()
    1.11 @@ -406,6 +407,7 @@
    1.12  BranchObj* BranchObj::first()
    1.13  {
    1.14  	itLast=NULL;	
    1.15 +	itFirst=this;
    1.16  	return this; 
    1.17  }
    1.18  	
    1.19 @@ -416,15 +418,17 @@
    1.20  	BranchObj *po=(BranchObj*)(parObj);
    1.21  
    1.22  	if (!itLast)
    1.23 -	{	// We are just beginning at the mapCenter
    1.24 +	{
    1.25  		if (bo) 
    1.26 -		{
    1.27 +		{	// We are just beginning, 
    1.28 +			// return first child  
    1.29  			itLast=this;
    1.30  			return bo;
    1.31  		}	
    1.32  		else
    1.33  		{
    1.34 -			itLast=NULL;
    1.35 +			// No childs
    1.36 +			itLast=this;
    1.37  			return NULL;
    1.38  		}	
    1.39  	}
    1.40 @@ -457,7 +461,7 @@
    1.41  		}
    1.42  	}
    1.43  
    1.44 -	// Try to find last child, we came from, in my own childs
    1.45 +	// Try to find last child, where we came from, in my own childs
    1.46  	bool searching=true;
    1.47  	while (bo && searching)
    1.48  	{
    1.49 @@ -476,6 +480,7 @@
    1.50  		{
    1.51  			if (po)
    1.52  			{
    1.53 +				if (this==itFirst) return NULL;	// Stop at starting point
    1.54  				// go up
    1.55  				itLast=this;
    1.56  				lmo=po->next();