aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stylesheet.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c
index 515d656..5372d52 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -188,18 +188,27 @@ static int read_template(struct slide_template *t, StyleSheet *ss,
for ( i=0; i<node->n_children; i++ ) {
- struct style *sty;
+ char *sn;
if ( strncmp(node->children[i]->key, "sty", 3) != 0 ) {
continue;
}
- sty = lookup_style(ss, node->children[i]->value);
- if ( sty == NULL ) {
- fprintf(stderr, "Couldn't find style '%s'\n",
- node->children[i]->value);
- } else {
- add_to_template(t, sty);
+ /* This looks a bit weird, but it's done so that the contents
+ * can go through the same validation as other fields */
+ if ( !get_field_s(node, node->children[i]->key, &sn) ) {
+
+ struct style *sty;
+
+ sty = lookup_style(ss, sn);
+ if ( sty == NULL ) {
+ fprintf(stderr, "Couldn't find style '%s'\n",
+ sn);
+ } else {
+ add_to_template(t, sty);
+ }
+
+ free(sn);
}
}