summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/models/parsetreenode.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-29 06:41:33 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-29 06:41:33 +0000
commitb22077cd600c183e406dea79548b50b5ec5e3585 (patch)
tree2db39ddb39364440dcfc869c94fc3bb6ba71479e /utils/themeeditor/models/parsetreenode.cpp
parent85040111fe204f805cc296a9de8715cb6d858b76 (diff)
downloadrockbox-b22077cd600c183e406dea79548b50b5ec5e3585.tar.gz
rockbox-b22077cd600c183e406dea79548b50b5ec5e3585.tar.bz2
rockbox-b22077cd600c183e406dea79548b50b5ec5e3585.zip
Theme Editor: Renderer now correctly handles special case with only one branch in a conditional
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27609 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 25351bf6a1..338f88525b 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -560,7 +560,9 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
else if(element->type == CONDITIONAL)
{
int child = evalTag(info, true, element->children_count).toInt();
- children[element->params_count + child]->render(info, viewport, true);
+ if(child < children.count())
+ children[element->params_count + child]
+ ->render(info, viewport, true);
}
else if(element->type == LINE_ALTERNATOR)
{
@@ -1016,6 +1018,8 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
if(child < branches)
return child;
+ else if(branches == 1)
+ return 2;
else
return branches - 1;
}