diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-02-14 19:27:52 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-02-15 16:48:50 +0100 |
commit | d41cf4ce1b1eddc030a85293ca7174e4c36750ce (patch) | |
tree | 2a06ed4153ad27009adbe3a1675cf89b81b38d56 /src/sc_editor.c | |
parent | 0a9a7aa1ddf4602798d975747d83db8a17907ecc (diff) |
Don't free logical stuff
All this stuff needs to be kept around for future re-rendering
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index 1331174..8f42c69 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -1346,58 +1346,9 @@ static gint realise_sig(GtkWidget *da, SCEditor *e) } -static void unset_all_frames(SCBlock *bl) -{ - while ( bl != NULL ) { - sc_block_set_frame(bl, NULL); - if ( sc_block_child(bl) != NULL ) { - unset_all_frames(sc_block_child(bl)); - } - if ( sc_block_macro_child(bl) != NULL ) { - unset_all_frames(sc_block_macro_child(bl)); - } - bl = sc_block_next(bl); - } -} - - -static void free_frame_contents(struct frame *fr) -{ - int i; - - if ( fr == NULL ) return; - - for ( i=0; i<fr->n_lines; i++ ) { - wrap_line_free(&fr->lines[i]); - } - free(fr->lines); - fr->lines = NULL; - fr->n_lines = 0; - fr->max_lines = 0; - - if ( fr->boxes != NULL ) { - free(fr->boxes->boxes); - free(fr->boxes); - } - - fr->boxes = NULL; - - for ( i=0; i<fr->num_children; i++ ) { - free_frame_contents(fr->children[i]); - } - - fr->num_children = 0; -} - - void sc_editor_set_scblock(SCEditor *e, SCBlock *scblocks) { - unset_all_frames(e->scblocks); e->scblocks = scblocks; - - /* Free all subframes */ - free_frame_contents(sc_block_frame(e->scblocks)); - rerender(e); redraw_editor(e); } |