Bug in Tree::getNextSelectedItemFromList

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

earthsruler
Quite a regular
Quite a regular
Posts: 74
Joined: Mon Apr 28, 2008 23:21
Location: Australia

Bug in Tree::getNextSelectedItemFromList

Postby earthsruler » Thu Jul 30, 2009 02:29

Hey all.

Now I know that generally there is nothing but hate for the current tree widget implementation, but none the less i have found a bug in it and fixed it.

The function Tree::getNextSelectedItemFromList wouldn't actually find the next selected item if the current selected item was on a different branch of the tree of nested deeper than the next selected one, if that makes sense :)

This can be fixed quite simply by making the foundStartItem paramater a reference:

Code: Select all

TreeItem* Tree::getNextSelectedItemFromList(const LBItemList &itemList, const TreeItem* startItem, bool& foundStartItem) const


after that items found on a branch will be notified to their recursive parent calls. YAY! This will generate 3 errors from places calling it but that is an easy fix like this:

Code: Select all

bool found = true;
getNextSelectedItemFromList( itemList, startItem, found );


instead of:

Code: Select all

getNextSelectedItemFromList( itemList, startItem, true );


Thanks!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug in Tree::getNextSelectedItemFromList

Postby CrazyEddie » Fri Jul 31, 2009 08:37

Hi,

Thanks for this, I'll have a closer look and probably make the change over the weekend :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug in Tree::getNextSelectedItemFromList

Postby CrazyEddie » Wed Aug 19, 2009 09:28

Ok, this morning I (finally!) got around to making this change (in trunk, since I'm done with v0-6).

Thanks again :)

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 6 guests