summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/themeeditor/parsetreenode.cpp13
-rw-r--r--utils/themeeditor/skin_debug.c4
-rw-r--r--utils/themeeditor/skin_parser.c28
-rw-r--r--utils/themeeditor/skin_parser.h1
4 files changed, 4 insertions, 42 deletions
diff --git a/utils/themeeditor/parsetreenode.cpp b/utils/themeeditor/parsetreenode.cpp
index b283e13038..70124c338d 100644
--- a/utils/themeeditor/parsetreenode.cpp
+++ b/utils/themeeditor/parsetreenode.cpp
@@ -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);
diff --git a/utils/themeeditor/skin_debug.c b/utils/themeeditor/skin_debug.c
index 360d7208b9..4d691892ff 100644
--- a/utils/themeeditor/skin_debug.c
+++ b/utils/themeeditor/skin_debug.c
@@ -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++)
diff --git a/utils/themeeditor/skin_parser.c b/utils/themeeditor/skin_parser.c
index 860970b7e7..9ff4f90115 100644
--- a/utils/themeeditor/skin_parser.c
+++ b/utils/themeeditor/skin_parser.c
@@ -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;
diff --git a/utils/themeeditor/skin_parser.h b/utils/themeeditor/skin_parser.h
index ca2d7bc54b..d3821c0f9b 100644
--- a/utils/themeeditor/skin_parser.h
+++ b/utils/themeeditor/skin_parser.h
@@ -47,7 +47,6 @@ enum skin_element_type
SUBLINES,
CONDITIONAL,
TAG,
- NEWLINE,
TEXT,
COMMENT,
};