Fixed: Parser crash when adding an XML layout with an unhandled type.
svn-id: r34801
This commit is contained in:
parent
b3625cae2f
commit
820a45d851
2 changed files with 6 additions and 1 deletions
|
@ -151,6 +151,8 @@ void ThemeEval::addLayout(ThemeLayout::LayoutType type, int spacing, bool center
|
||||||
layout = new ThemeLayoutVertical(_curLayout.top(), spacing, center);
|
layout = new ThemeLayoutVertical(_curLayout.top(), spacing, center);
|
||||||
else if (type == ThemeLayout::kLayoutHorizontal)
|
else if (type == ThemeLayout::kLayoutHorizontal)
|
||||||
layout = new ThemeLayoutHorizontal(_curLayout.top(), spacing, center);
|
layout = new ThemeLayoutHorizontal(_curLayout.top(), spacing, center);
|
||||||
|
|
||||||
|
assert(layout);
|
||||||
|
|
||||||
layout->setPadding(
|
layout->setPadding(
|
||||||
getVar("Globals.Padding.Left", 0),
|
getVar("Globals.Padding.Left", 0),
|
||||||
|
|
|
@ -605,7 +605,10 @@ bool ThemeParser::parserCallback_layout(ParserNode *node) {
|
||||||
|
|
||||||
else if (node->values["type"] == "horizontal")
|
else if (node->values["type"] == "horizontal")
|
||||||
_theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutHorizontal, spacing, node->values["center"] == "true");
|
_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")) {
|
if (node->values.contains("padding")) {
|
||||||
int paddingL, paddingR, paddingT, paddingB;
|
int paddingL, paddingR, paddingT, paddingB;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue