1
0
Fork 0
forked from len0rd/rockbox

Theme Editor: Fixed bugs in code generation and viewport parsing

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26464 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-06-02 06:41:41 +00:00
parent 4003f35dc7
commit e25c903bfe
2 changed files with 15 additions and 7 deletions

View file

@ -97,6 +97,14 @@ QString ParseTreeNode::genCode() const
{ {
case VIEWPORT: case VIEWPORT:
buffer.append(children[0]->genCode());
if(!children[0]->isParam()
&& children[0]->getElement()->type == TAG)
buffer.append('\n');
for(int i = 1; i < children.count(); i++)
buffer.append(children[i]->genCode());
break;
case LINE: case LINE:
for(int i = 0; i < children.count(); i++) for(int i = 0; i < children.count(); i++)
{ {
@ -107,9 +115,10 @@ QString ParseTreeNode::genCode() const
if(children[i]->element->type == TAG) if(children[i]->element->type == TAG)
buffer.append(TAGSYM); buffer.append(TAGSYM);
buffer.append(children[i]->genCode()); buffer.append(children[i]->genCode());
if(element->type == LINE || i == 0)
buffer.append('\n'); buffer.append('\n');
} }
if(children.count() == 0)
buffer.append('\n');
break; break;
case SUBLINES: case SUBLINES:

View file

@ -163,11 +163,7 @@ struct skin_element* skin_parse_viewport(char** document)
else else
to_write = &(last->next); to_write = &(last->next);
if(*cursor == '\n') if(sublines)
{
cursor++;
}
else if(sublines)
{ {
*to_write = skin_parse_sublines(&cursor); *to_write = skin_parse_sublines(&cursor);
last = *to_write; last = *to_write;
@ -188,6 +184,9 @@ struct skin_element* skin_parse_viewport(char** document)
while(last->next) while(last->next)
last = last->next; last = last->next;
if(*cursor == '\n')
cursor++;
} }
*document = cursor; *document = cursor;