[sword-devel] Best way to work with Genbooks
David "Judah's Shadow" Blue
yudahsshadow at gmx.com
Thu Apr 4 16:00:12 EDT 2024
On Thursday, April 4, 2024 11:17:57 AM EDT you wrote:
> Hi David,
>
> I don't know the classes you are using, but maybe you have to do
> something like this:
>
> if(treeKey->firstChild()) {
> do {
> this->toc += treeKey->getText();
> //Add a space around the new line for the tokenizer to split on
> this->toc += "\n ";
> if(treeKey->hasChildren()) {
> this->walkTree(treeKey);
> }
> }
> while(treeKey->nextSibling());
>
> treeKey->parent();
> }
Yep, changing the while to a do while did the trick. Apparently the while was
skipping the first time
More information about the sword-devel
mailing list