diff options
author | Thomas White <taw@bitwiz.me.uk> | 2018-11-12 23:42:11 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2018-11-12 23:42:11 +0100 |
commit | c41fa6a9efb39e4fd0a964b7a83000647e4d32bf (patch) | |
tree | 4be67ea84bbc150eb95e2f73fc06e83b88986090 /src | |
parent | 2b24011bcdcd96ce4499135ac55fa4de95392302 (diff) |
add_newpara: Set alignment and spacing for new paragraph
Diffstat (limited to 'src')
-rw-r--r-- | src/sc_interp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c index 0d65475..07f09a5 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -847,9 +847,12 @@ static void maybe_recurse_after(SCInterpreter *scin, SCBlock *child, } -static void add_newpara(struct frame *fr, SCBlock *bl) +static void add_newpara(SCBlock *bl, SCInterpreter *scin) { Paragraph *last_para; + Paragraph *para; + struct sc_state *st = &scin->state[scin->j]; + struct frame *fr = sc_interp_get_frame(scin); if ( fr->paras == NULL ) return; last_para = fr->paras[fr->n_paras-1]; @@ -858,7 +861,9 @@ static void add_newpara(struct frame *fr, SCBlock *bl) /* The block after the \newpara will always be the first one of the * next paragraph, by definition, even if it's \f or another \newpara */ - create_paragraph(fr, sc_block_next(bl)); + para = create_paragraph(fr, sc_block_next(bl)); + set_para_alignment(para, st->alignment); + set_para_spacing(para, st->paraspace); } @@ -1020,8 +1025,7 @@ static int check_outputs(SCBlock *bl, SCInterpreter *scin, Stylesheet *ss) output_frame(scin, bl, ss, "$.slide.footer"); } else if ( strcmp(name, "newpara")==0 ) { - struct frame *fr = sc_interp_get_frame(scin); - add_newpara(fr, bl); + add_newpara(bl, scin); } else if ( strcmp(name, "slidenumber")==0 ) { char *con = get_constant(scin, SCCONST_SLIDENUMBER); |