aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-08-10 22:58:51 +0200
committerThomas White <taw@bitwiz.org.uk>2014-08-10 22:58:51 +0200
commit2b060821379df8183c2d80f9309b2a4cc0f7b95d (patch)
treeea6afc67d63c85a5536ea1954af004022ff1401a
parente415d92a4b18ab901bdfbf51e5078fd889ea0765 (diff)
Don't create extra slides on load
-rw-r--r--src/mainwindow.c11
-rw-r--r--src/presentation.c3
2 files changed, 10 insertions, 4 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 03cb4f2..c01ed1b 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -432,8 +432,13 @@ static gint new_sig(GtkWidget *widget, struct presentation *pnn)
p = new_presentation();
if ( p != NULL ) {
- p->cur_edit_slide = add_slide(p, 0);
+ struct slide *new;
+ new = add_slide(p, 0);
p->completely_empty = 1;
+ /* FIXME: position */
+ new->scblocks = sc_block_append_inside(p->scblocks, "slide",
+ NULL, NULL);
+
open_mainwindow(p);
}
@@ -665,6 +670,10 @@ static gint add_slide_sig(GtkWidget *widget, struct presentation *p)
cur_slide_number = slide_number(p, p->cur_edit_slide);
new = add_slide(p, cur_slide_number+1);
+ /* FIXME: position */
+ new->scblocks = sc_block_append_inside(p->scblocks, "slide",
+ NULL, NULL);
+
change_edit_slide(p, new);
return FALSE;
diff --git a/src/presentation.c b/src/presentation.c
index 9013249..919aad2 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -106,8 +106,6 @@ int insert_slide(struct presentation *p, struct slide *new, int pos)
p->slides[pos] = new;
p->num_slides++;
- new->scblocks = sc_block_append_inside(p->scblocks, "slide",
- NULL, NULL);
new->parent = p;
renumber_slides(p);
@@ -322,7 +320,6 @@ int save_presentation(struct presentation *p, const char *filename)
fh = fopen(filename, "w");
if ( fh == NULL ) return 1;
- show_sc_blocks(p->scblocks);
save_sc_block(fh, p->scblocks);
/* Slightly fiddly because someone might