[Scummvm-cvs-logs] SF.net SVN: scummvm:[34801] scummvm/trunk/gui
Tanoku at users.sourceforge.net
Tanoku at users.sourceforge.net
Tue Oct 14 19:29:49 CEST 2008
Revision: 34801
http://scummvm.svn.sourceforge.net/scummvm/?rev=34801&view=rev
Author: Tanoku
Date: 2008-10-14 17:29:48 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
Fixed: Parser crash when adding an XML layout with an unhandled type.
Modified Paths:
--------------
scummvm/trunk/gui/ThemeEval.cpp
scummvm/trunk/gui/ThemeParser.cpp
Modified: scummvm/trunk/gui/ThemeEval.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEval.cpp 2008-10-14 17:22:25 UTC (rev 34800)
+++ scummvm/trunk/gui/ThemeEval.cpp 2008-10-14 17:29:48 UTC (rev 34801)
@@ -151,6 +151,8 @@
layout = new ThemeLayoutVertical(_curLayout.top(), spacing, center);
else if (type == ThemeLayout::kLayoutHorizontal)
layout = new ThemeLayoutHorizontal(_curLayout.top(), spacing, center);
+
+ assert(layout);
layout->setPadding(
getVar("Globals.Padding.Left", 0),
Modified: scummvm/trunk/gui/ThemeParser.cpp
===================================================================
--- scummvm/trunk/gui/ThemeParser.cpp 2008-10-14 17:22:25 UTC (rev 34800)
+++ scummvm/trunk/gui/ThemeParser.cpp 2008-10-14 17:29:48 UTC (rev 34801)
@@ -605,7 +605,10 @@
else if (node->values["type"] == "horizontal")
_theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutHorizontal, spacing, node->values["center"] == "true");
-
+ else
+ return parserError("Invalid layout type. Only 'horizontal' and 'vertical' layouts allowed.");
+
+
if (node->values.contains("padding")) {
int paddingL, paddingR, paddingT, paddingB;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list