TinyXMLParser failure to parse reports no error

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

Arinae
Just popping in
Just popping in
Posts: 1
Joined: Sat Nov 22, 2008 20:58
Location: Canberra, Australia

TinyXMLParser failure to parse reports no error

Postby Arinae » Sat Nov 22, 2008 21:12

Hi. I'm just learning how to use your very comprehensive GUI system. While writing my layout, I accidentally added a comma to separate XML attributes (too much Lua coding, I think). I spent a long afternoon wondering why only some of my layout was being drawn before noticing it.

I checked the code, and it looks like in the TinyXMLDocument constructor CEGUITinyXML::TiXmlDocument::parse() is called without checking the return value. Checking for NULL and throwing makes sure errant commas won't bother me again.

I suspect that fixing this could save a lot of headaches for other CEGUI newbies.

(I am only using 0.5, but I checked trunk in the SVN browser and it would appear to have the same problem)

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

Postby CrazyEddie » Sun Nov 23, 2008 16:30

Hi, and welcome :)

Thanks for reporting the issue. I'll make sure it doesn't bother anybody else either ;)

CE.

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

Postby earthsruler » Thu Nov 27, 2008 08:25

Just some food for thought here:

This is the comment for the parse function that is now being checked:

Code: Select all


   /*   Attribute parsing starts: first letter of the name
                   returns: the next char after the value end quote
   */


Therefore (as i found when i updated) not having a blank line at the end of a valid layout will make it throw an error which i believe is far more likely to burn noobies :).

Based on that comment I'm not sure that checking the return value for validity is correct usage. I have been wrong before though :wink:

ER.

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

Postby CrazyEddie » Thu Nov 27, 2008 09:44

Hmmmm :?

I may look into this and see what I can do (perhaps checking the end of the loaded data and adding a newline if it's missing).

Thanks for the heads-up on the potential new issue :)

CE.

[Edit]
I added a fix for this. It's basically a kludge, but it works :-p

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

Postby earthsruler » Fri Nov 28, 2008 00:00

Sweet thanks.

I had already added a new line to the end of all our files manually though :(, but this will fix and new messed up files.

ER.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 0 guests