diff -r 41c3d7f9f532 -r 557239819c45 branchobj.cpp --- a/branchobj.cpp Tue Aug 29 08:31:42 2006 +0000 +++ b/branchobj.cpp Wed Aug 30 12:16:25 2006 +0000 @@ -14,6 +14,7 @@ ///////////////////////////////////////////////////////////////// BranchObj* BranchObj::itLast=NULL; +BranchObj* BranchObj::itFirst=NULL; BranchObj::BranchObj () :OrnamentedObj() @@ -406,6 +407,7 @@ BranchObj* BranchObj::first() { itLast=NULL; + itFirst=this; return this; } @@ -416,15 +418,17 @@ BranchObj *po=(BranchObj*)(parObj); if (!itLast) - { // We are just beginning at the mapCenter + { if (bo) - { + { // We are just beginning, + // return first child itLast=this; return bo; } else { - itLast=NULL; + // No childs + itLast=this; return NULL; } } @@ -457,7 +461,7 @@ } } - // Try to find last child, we came from, in my own childs + // Try to find last child, where we came from, in my own childs bool searching=true; while (bo && searching) { @@ -476,6 +480,7 @@ { if (po) { + if (this==itFirst) return NULL; // Stop at starting point // go up itLast=this; lmo=po->next();