PropertyDefinition bug?

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

noensr
Just popping in
Just popping in
Posts: 1
Joined: Mon Feb 15, 2010 00:42

PropertyDefinition bug?

Postby noensr » Mon Feb 15, 2010 01:03

Hello,

in PropertyDefinition::set(), the name of the property is added to the window with setUserString(d_userStringName,...).
Now when you add a PropertyDefinition to a PropertySet, the set() function doesn't get called, so you have to call it manually. The property exists, but it isn't in the right map.
There is an exception at this point:

String PropertyDefinition::get(const PropertyReceiver* receiver) const
{
return static_cast<const Window*>(receiver)->getUserString(d_userStringName); <----------- setUserString() was never called !!!
}

I don't know if you consider this a bug, but it is pretty hard to find this problem if you encounter it.

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

Re: PropertyDefinition bug?

Postby CrazyEddie » Mon Feb 15, 2010 09:10

Hi,

I looked at the code, and it's definitely a bug as far as I can tell. The issue has never come up previously, so must be getting 'covered' by some other operation.

Thanks for catching this one - it must have been in there lurking since 2005 :) I've added a ticket for the issue and it should get fixed some time soon.

CE.

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

Re: PropertyDefinition bug?

Postby CrazyEddie » Sat Feb 20, 2010 11:02

This issue is fixed in branches/v0-7 r2431.

The implementation of the fix uses try/catch to save a double look up of the user string name, and is therefore more optimal for the usual case (where the user string already exists). A side-effect of this implementation does mean that the error is still logged, though this is a consequence of the way CEGUI::Exception is currently written (might look to address that in the future).

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 10 guests