1
0
Fork 0
forked from len0rd/rockbox

Theme Editor: Removed the NEWLINE parse tree element

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26463 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-06-02 06:12:18 +00:00
parent f16adb045a
commit 4003f35dc7
4 changed files with 4 additions and 42 deletions

View file

@ -107,6 +107,8 @@ QString ParseTreeNode::genCode() const
if(children[i]->element->type == TAG)
buffer.append(TAGSYM);
buffer.append(children[i]->genCode());
if(element->type == LINE || i == 0)
buffer.append('\n');
}
break;
@ -117,6 +119,7 @@ QString ParseTreeNode::genCode() const
if(i != children.count() - 1)
buffer.append(MULTILINESYM);
}
buffer.append('\n');
break;
case CONDITIONAL:
@ -156,10 +159,6 @@ QString ParseTreeNode::genCode() const
}
break;
case NEWLINE:
buffer.append('\n');
break;
case TEXT:
for(char* cursor = element->text; *cursor; cursor++)
{
@ -253,9 +252,6 @@ QVariant ParseTreeNode::data(int column) const
case TAG:
return QObject::tr("Tag");
case NEWLINE:
return QObject::tr("Newline");
case TEXT:
return QObject::tr("Plaintext");
}
@ -295,9 +291,6 @@ QVariant ParseTreeNode::data(int column) const
case CONDITIONAL:
return QString();
case NEWLINE:
return QObject::tr("\\n");
case TEXT:
case COMMENT:
return QString(element->text);

View file

@ -107,10 +107,6 @@ void skin_debug_tree(struct skin_element* root)
current->text);
break;
case NEWLINE:
printf("[ Newline on line %d ]\n", current->line);
break;
case COMMENT:
printf("[ Comment on line %d: ", current->line);
for(i = 0; i < (int)strlen(current->text); i++)

View file

@ -49,7 +49,6 @@ int skin_parse_tag(struct skin_element* element, char** document);
int skin_parse_text(struct skin_element* element, char** document,
int conditional);
int skin_parse_conditional(struct skin_element* element, char** document);
int skin_parse_newline(struct skin_element* element, char** document);
int skin_parse_comment(struct skin_element* element, char** document);
struct skin_element* skin_parse_code_as_arg(char** document);
@ -166,10 +165,7 @@ struct skin_element* skin_parse_viewport(char** document)
if(*cursor == '\n')
{
*to_write = skin_alloc_element();
skin_parse_newline(*to_write, &cursor);
if(!last)
return NULL;
cursor++;
}
else if(sublines)
{
@ -705,28 +701,6 @@ int skin_parse_conditional(struct skin_element* element, char** document)
return 1;
}
int skin_parse_newline(struct skin_element* element, char** document)
{
char* cursor = *document;
if(*cursor != '\n')
{
skin_error(NEWLINE_EXPECTED);
return 0;
}
cursor++;
/* Assembling a skin_element struct for a newline */
element->type = NEWLINE;
element->line = skin_line;
skin_line++;
element->next = NULL;
*document = cursor;
return 1;
}
int skin_parse_comment(struct skin_element* element, char** document)
{
char* cursor = *document;

View file

@ -47,7 +47,6 @@ enum skin_element_type
SUBLINES,
CONDITIONAL,
TAG,
NEWLINE,
TEXT,
COMMENT,
};