aboutsummaryrefslogtreecommitdiff
path: root/src/presentation.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2017-03-02 22:41:55 +0100
committerThomas White <taw@bitwiz.org.uk>2017-03-02 22:45:14 +0100
commita6a8a827ff3c6133f229b0c444b42d4e690fef76 (patch)
treeedd80a35c40c32299e6d2331e483e37506d219c9 /src/presentation.c
parente7eede3273394f3479bb63f92e57780dfc8f2e3d (diff)
Substitute style sheet when there was no stylesheet before
Diffstat (limited to 'src/presentation.c')
-rw-r--r--src/presentation.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/presentation.c b/src/presentation.c
index 55219e2..efdf694 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -360,6 +360,12 @@ int replace_stylesheet(struct presentation *p, SCBlock *ss)
/* Create style sheet from union of old and new,
* preferring items from the new one */
+ /* If there was no stylesheet before, add a dummy one */
+ if ( p->stylesheet == NULL ) {
+ p->stylesheet = sc_block_append_end(p->scblocks,
+ "stylesheet", NULL, NULL);
+ }
+
/* Cut the old stylesheet out of the presentation,
* and put in the new one */
sc_block_substitute(&p->scblocks, p->stylesheet, ss);