diff options
Diffstat (limited to 'src/presentation.c')
-rw-r--r-- | src/presentation.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/presentation.c b/src/presentation.c index 9261307..cf0d971 100644 --- a/src/presentation.c +++ b/src/presentation.c @@ -67,6 +67,7 @@ void free_presentation(struct presentation *p) int insert_slide(struct presentation *p, struct slide *new, int pos) { struct slide **try; + int i; try = realloc(p->slides, (1+p->num_slides)*sizeof(struct slide *)); if ( try == NULL ) { @@ -98,6 +99,13 @@ int insert_slide(struct presentation *p, struct slide *new, int pos) new->parent = p; p->num_slides++; + for ( i=pos+1; i<p->num_slides; i++ ) { + struct object *o = p->slides[i]->roles[S_ROLE_SLIDENUMBER]; + if ( o != NULL ) { + o->update_object(o); + } + } + return 0; } @@ -141,7 +149,9 @@ struct slide *add_slide(struct presentation *p, int pos) return NULL; } + /* Copy roles and references to this slide as applicable */ if ( pos >= 0 ) { + struct slide *ex = p->slides[pos]; s->roles[S_ROLE_PTITLE_REF] = ex->roles[S_ROLE_PTITLE_REF]; |