1
0
forked from 0ad/0ad

Added tolerance for whitespace, to fix assert

This was SVN commit r593.
This commit is contained in:
Ykkrosh 2004-06-23 16:00:19 +00:00
parent ca4558d48d
commit 20211609c5

View File

@ -1111,24 +1111,27 @@ void CGUI::Xerces_ReadObject(DOMElement *pElement, IGUIObject *pParent)
{
CStr caption = XMLTranscode( child->getNodeValue() );
// Text is only okay if it's the first element i.e. <object>caption ... </object>
if (i==0)
{
// Thank you CStr =)
caption.Trim(PS_TRIM_BOTH);
caption = caption.Trim(PS_TRIM_BOTH);
try
if (caption.Length())
{
// Text is only okay if it's the first element i.e. <object>caption ... </object>
if (i==0)
{
// Set the setting caption to this
object->SetSetting("caption", caption);
}
catch (...)
{
// There is no harm if the object didn't have a "caption"
try
{
// Set the setting caption to this
object->SetSetting("caption", caption);
}
catch (...)
{
// There is no harm if the object didn't have a "caption"
}
}
else
debug_warn("Text is only okay if it's the first element i.e. <object>caption ... </object>");
}
else
debug_warn("Text is only okay if it's the first element i.e. <object>caption ... </object>");
}
}