From 0f7100a65c102ee23ae4066ce790f315a68c6adb Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 17 Feb 2003 02:58:09 +0000 Subject: make this actually work: destroy the canvas item, memmove stuff around, 2003-02-16 Chris Toshok * gal/widgets/e-reflow.c (item_removed): make this actually work: destroy the canvas item, memmove stuff around, change reflow->count, etc, etc. svn path=/trunk/; revision=19918 --- widgets/misc/e-reflow.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'widgets/misc') diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index 70b1f4a470..8754c5a042 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -334,6 +334,14 @@ item_removed (EReflowModel *model, int i, EReflow *reflow) if (i < 0 || i >= reflow->count) return; + if (reflow->items[i]) + gtk_object_destroy (GTK_OBJECT (reflow->items[i])); + + memmove (reflow->heights + i, reflow->heights + i + 1, (reflow->count - i - 1) * sizeof (int)); + memmove (reflow->items + i, reflow->items + i + 1, (reflow->count - i - 1) * sizeof (GnomeCanvasItem *)); + + reflow->count --; + sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i); for (c = reflow->column_count - 1; c >= 0; c--) { int start_of_column = reflow->columns[c]; @@ -347,6 +355,10 @@ item_removed (EReflowModel *model, int i, EReflow *reflow) break; } } + + e_sorter_array_set_count (reflow->sorter, reflow->count); + + e_selection_model_simple_delete_rows (E_SELECTION_MODEL_SIMPLE (reflow->selection), i, 1); } static void -- cgit