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

View file

@ -107,10 +107,6 @@ void skin_debug_tree(struct skin_element* root)
current->text); current->text);
break; break;
case NEWLINE:
printf("[ Newline on line %d ]\n", current->line);
break;
case COMMENT: case COMMENT:
printf("[ Comment on line %d: ", current->line); printf("[ Comment on line %d: ", current->line);
for(i = 0; i < (int)strlen(current->text); i++) 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 skin_parse_text(struct skin_element* element, char** document,
int conditional); int conditional);
int skin_parse_conditional(struct skin_element* element, char** document); 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); int skin_parse_comment(struct skin_element* element, char** document);
struct skin_element* skin_parse_code_as_arg(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') if(*cursor == '\n')
{ {
*to_write = skin_alloc_element(); cursor++;
skin_parse_newline(*to_write, &cursor);
if(!last)
return NULL;
} }
else if(sublines) else if(sublines)
{ {
@ -705,28 +701,6 @@ int skin_parse_conditional(struct skin_element* element, char** document)
return 1; 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) int skin_parse_comment(struct skin_element* element, char** document)
{ {
char* cursor = *document; char* cursor = *document;

View file

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