From: Markus R. <rol...@un...> - 2007-06-11 17:31:04
|
Markus Rollmann wrote: [...] > yes, I think the problem is that in the recursive case the result of > FindChildSupportingClass(...) for the first found child is immediately > returned. So if the first child does not have a matching node the function > returns immediately false instead of testing further children. > > The fix should be to add a second inner loop that checks all children of the > current node and then returns for the first found node. I commited a fix to the simspark CVS, a second loop wasn't necessary. Find the diff below. regards, Markus Index: leaf.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** leaf.h 17 May 2007 17:46:45 -0000 1.3 --- leaf.h 11 Jun 2007 17:27:05 -0000 1.3.2.1 *************** *** 130,134 **** if (recursive) { ! return (*i)->FindChildSupportingClass<CLASS>(recursive); } } --- 130,138 ---- if (recursive) { ! child = (*i)->FindChildSupportingClass<CLASS>(recursive); ! if (child.get() != 0) ! { ! return child; ! } } } |