gnumeric r16793 - trunk/src/dialogs
- From: guelzow svn gnome org
- To: svn-commits-list gnome org
- Subject: gnumeric r16793 - trunk/src/dialogs
- Date: Sat, 13 Sep 2008 23:35:20 +0000 (UTC)
Author: guelzow
Date: Sat Sep 13 23:35:20 2008
New Revision: 16793
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16793&view=rev
Log:
2008-09-13 Andreas J. Guelzow <aguelzow pyrshep ca>
* dialog-function-select.c (cb_dialog_function_select_cat_selection_changed):
reorganize and remove dead code.
Modified:
trunk/src/dialogs/ChangeLog
trunk/src/dialogs/dialog-function-select.c
Modified: trunk/src/dialogs/dialog-function-select.c
==============================================================================
--- trunk/src/dialogs/dialog-function-select.c (original)
+++ trunk/src/dialogs/dialog-function-select.c Sat Sep 13 23:35:20 2008
@@ -460,7 +460,7 @@
GtkTreeIter iter;
GtkTreeModel *model;
GnmFuncGroup const * cat;
- GSList *funcs, *ptr;
+ GSList *funcs = NULL, *ptr;
GnmFunc const *func;
gtk_list_store_clear (state->model_f);
@@ -471,8 +471,8 @@
-1);
if (cat != NULL) {
if (cat == GINT_TO_POINTER(-1)) {
+ /* Show all functions */
int i = 0;
- funcs = NULL;
while ((cat = gnm_func_group_get_nth (i++)) != NULL)
funcs = g_slist_concat (funcs,
@@ -480,39 +480,28 @@
funcs = g_slist_sort (funcs,
dialog_function_select_by_name);
- } else
+ } else
+ /* Show category cat */
funcs = g_slist_sort (g_slist_copy (cat->functions),
dialog_function_select_by_name);
- for (ptr = funcs; ptr; ptr = ptr->next) {
- func = ptr->data;
- if (!(func->flags & GNM_FUNC_INTERNAL)) {
- gtk_list_store_append (state->model_f, &iter);
- gtk_list_store_set (state->model_f, &iter,
- FUN_NAME, gnm_func_get_name (func),
- FUNCTION, func,
- -1);
- }
- }
- g_slist_free (funcs);
- } else if (cat == NULL) {
- for (ptr = state->recent_funcs; ptr != NULL; ptr = ptr->next) {
- func = ptr->data;
+ } else
+ /* Show recent functions */
+ funcs = state->recent_funcs;
+
+ for (ptr = funcs; ptr; ptr = ptr->next) {
+ func = ptr->data;
+ if (!(func->flags & GNM_FUNC_INTERNAL)) {
gtk_list_store_append (state->model_f, &iter);
gtk_list_store_set (state->model_f, &iter,
- FUN_NAME, gnm_func_get_name (func),
- FUNCTION, func,
- -1);
+ FUN_NAME, gnm_func_get_name (func),
+ FUNCTION, func,
+ -1);
}
- } else {
- int i = 0;
- funcs = NULL;
-
- while ((cat = gnm_func_group_get_nth (i++)) != NULL)
- funcs = g_slist_concat (funcs, g_slist_copy (cat->functions));
-
- funcs = g_slist_sort (funcs, dialog_function_select_by_name);
}
+
+ if (funcs != state->recent_funcs)
+ g_slist_free (funcs);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]