From 8ea056db4b6c60e2e623cd0e79ccb64aea5bec51 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Thu, 27 May 2010 19:57:15 +0000 Subject: Theme Editor: Fixed a bug in the subline parser, added a LINE element to contain logical lines, working on data model git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26337 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/skin_parser.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'utils/themeeditor/skin_parser.c') diff --git a/utils/themeeditor/skin_parser.c b/utils/themeeditor/skin_parser.c index dd061a1ac9..a6c5ea41a2 100644 --- a/utils/themeeditor/skin_parser.c +++ b/utils/themeeditor/skin_parser.c @@ -151,6 +151,14 @@ struct skin_element* skin_parse_line_optional(char** document, int conditional) struct skin_element* root = NULL; struct skin_element* current = NULL; + struct skin_element* retval = NULL; + + /* A wrapper for the line */ + retval = skin_alloc_element(); + retval->type = LINE; + retval->line = skin_line; + retval->children_count = 1; + retval->children = skin_alloc_children(1); while(*cursor != '\n' && *cursor != '\0' && *cursor != MULTILINESYM && !((*cursor == ARGLISTSEPERATESYM @@ -214,7 +222,8 @@ struct skin_element* skin_parse_line_optional(char** document, int conditional) /* Moving up the calling function's pointer */ *document = cursor; - return root; + retval->children[0] = root; + return retval; } struct skin_element* skin_parse_sublines(char** document) @@ -233,6 +242,7 @@ struct skin_element* skin_parse_sublines_optional(char** document, retval = skin_alloc_element(); retval->type = SUBLINES; retval->next = NULL; + retval->line = skin_line; /* First we count the sublines */ while(*cursor != '\0' && *cursor != '\n' @@ -276,7 +286,7 @@ struct skin_element* skin_parse_sublines_optional(char** document, skin_error(MULTILINE_EXPECTED); return NULL; } - else + else if(i != sublines - 1) { cursor++; } -- cgit v1.2.3