diff options
author | Thomas White <taw@physics.org> | 2018-02-18 18:25:00 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-03-03 17:57:41 +0100 |
commit | 4b757f1f48643e9b049e4c868c94d127a6bc8c1c (patch) | |
tree | 2361a14bbd158677faef53c36dca790c3f45385f /src/sc_editor.c | |
parent | 2a80430b0e762e7ee3ccd0c8a620baf40fb30b12 (diff) |
Remove macro_real_block and friends, and delete text based on SCBlocks instead of runs
macro_real_block was a pain because it meant we needed to look somewhere
else every time we needed the SCBlock for something. The new way is to
have two SCBlocks for each run, one which is the block from the flow of
the actual document (i.e. for blocks within macros, this is the
macro_real_block, otherwise it's the same as before). The second block
("rscblock") is whichever run actually contains the text for the run.
It might be from the document, within the macro definition or within the
macro's "\contents".
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index c872acc..6b8ba69 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -853,8 +853,8 @@ static void insert_text(char *t, SCEditor *e) fprintf(stderr, "Failed to insert paragraph\n"); return; } - add_run(pnew, ad, NULL, NULL, strlen(t), - e->cursor_frame->fontdesc, e->cursor_frame->col, 0); + add_run(pnew, ad, ad, strlen(t), + e->cursor_frame->fontdesc, e->cursor_frame->col); wrap_frame(e->cursor_frame, e->pc); @@ -1076,7 +1076,7 @@ static void check_paragraph(struct frame *fr, PangoContext *pc, } scblocks = sc_block_append(scblocks, NULL, NULL, strdup(""), NULL); - add_run(para, scblocks, NULL, NULL, 0, fr->fontdesc, fr->col, 0); + add_run(para, scblocks, scblocks, 0, fr->fontdesc, fr->col); wrap_paragraph(para, pc, fr->w - fr->pad_l - fr->pad_r, 0, 0); } |