<div>It's probably easier to create a new TreeKey along the way, otherwise it won't work properly (going to the parent at the end will lose the place in the sibling iteration).<br>Â </div>
<div>void getSectionsList(TreeKey tk, list l)<br>{</div>
<div>Â Â Â Â Â do {<br>Â Â Â Â Â Â Â Â Â Â Â l.append (tk->getText());<br>Â Â Â Â Â Â Â Â Â Â Â if (tk->hasChildren())<br>Â Â Â Â Â Â Â Â Â Â Â {</div>
<div>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â TreeKey new_tk = tk.clone();<br>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â new_tk->firstChild();<br>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â getSectionsList(new_tk, l);</div>
<div>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â delete new_tk;</div>
<div>Â Â Â Â Â Â Â Â Â Â Â Â }<br>Â Â Â Â Â Â Â } while (tk->nextSibling())<br>}</div>
<div>Â </div>
<div>Untested code, of course...</div>
<div>Â </div>
<div>God Bless,<br>Ben<br>-------------------------------------------------------------------------------------------<br>Multitudes, multitudes,<br>Â Â Â Â in the valley of decision!<br>For the day of the LORD is near<br>Â Â Â Â in the valley of decision.<br>
<br>Giôên 3:14 (ESV)<br> </div>
<div><span class="gmail_quote">On 03/11/2009, <b class="gmail_sendername">Matthew Talbert</b> <<a href="mailto:ransom1982@gmail.com">ransom1982@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">This might be better. I'm probably still missing some logic.<br><br>void getSectionsList(TreeKey tk, list l)<br>
{<br>Â Â Â Â Â Â l.append (tk->getText());<br>Â Â Â Â Â Â if tk->hasChildren()<br>Â Â Â Â Â Â {<br>Â Â Â Â Â Â Â Â Â Â tk->firstChild();<br>Â Â Â Â Â Â Â Â Â Â getSectionsList(tk, l);<br>Â Â Â Â Â Â }<br>Â Â Â Â while tk->nextSibling()<br>Â Â Â Â {<br>Â Â Â Â Â Â Â Â Â Â getSectionsList(tk, l);<br>
    }<br>    tk->parent();<br>}<br><br>Matthew<br><br>_______________________________________________<br>sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br></blockquote></div><br><br clear="all">