summaryrefslogtreecommitdiff
path: root/utils/themeeditor/models
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
parent85040111fe204f805cc296a9de8715cb6d858b76 (diff)
downloadrockbox-b22077cd600c183e406dea79548b50b5ec5e3585.tar.gz
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')
-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,
560 else if(element->type == CONDITIONAL) 560 else if(element->type == CONDITIONAL)
561 { 561 {
562 int child = evalTag(info, true, element->children_count).toInt(); 562 int child = evalTag(info, true, element->children_count).toInt();
563 children[element->params_count + child]->render(info, viewport, true); 563 if(child < children.count())
564 children[element->params_count + child]
565 ->render(info, viewport, true);
564 } 566 }
565 else if(element->type == LINE_ALTERNATOR) 567 else if(element->type == LINE_ALTERNATOR)
566 { 568 {
@@ -1016,6 +1018,8 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
1016 1018
1017 if(child < branches) 1019 if(child < branches)
1018 return child; 1020 return child;
1021 else if(branches == 1)
1022 return 2;
1019 else 1023 else
1020 return branches - 1; 1024 return branches - 1;
1021 } 1025 }