[gnumeric] sstest: patch up the previous patch sequence.



commit c91cd70e6fc743669f6e2357c80641f20a0fcd2e
Author: Morten Welinder <terra gnome org>
Date:   Wed Nov 29 20:34:56 2017 -0500

    sstest: patch up the previous patch sequence.

 ChangeLog          |    6 ++++++
 src/func-builtin.c |   10 +++++++++-
 src/func.c         |    5 +++++
 src/sstest.c       |   34 ++++++++++++++++++----------------
 4 files changed, 38 insertions(+), 17 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e01cdc2..8d85b7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-11-29  Morten Welinder  <terra gnome org>
 
+       * src/sstest.c (enumerate_functions): Make sure function is loaded.
+
+       * src/func-builtin.c (help_table): Add help text for TABLE.
+
+       * src/func.c (gnm_func_enumerate): Introspection annotation.
+
        * src/sstest.c (function_dump_defs): Move from func.c with all
        support code.
        (gnm_func_sanity_check): Ditto.
diff --git a/src/func-builtin.c b/src/func-builtin.c
index cba7080..51e7701 100644
--- a/src/func-builtin.c
+++ b/src/func-builtin.c
@@ -149,6 +149,14 @@ gnumeric_version (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 
 /***************************************************************************/
 
+static GnmFuncHelp const help_table[] = {
+       { GNM_FUNC_HELP_NAME, N_("TABLE:internal function for data tables")},
+       { GNM_FUNC_HELP_DESCRIPTION, N_("This function should not be called directly.")},
+       { GNM_FUNC_HELP_SEEALSO, ""},
+       { GNM_FUNC_HELP_END }
+};
+
+
 static GnmDependentFlags
 gnumeric_table_link (GnmFuncEvalInfo *ei, gboolean qlink)
 {
@@ -470,7 +478,7 @@ func_builtin_init (void)
                        GNM_FUNC_TEST_STATUS_EXHAUSTIVE
                },
                {       "table",        "",
-                       NULL,           NULL,   gnumeric_table,
+                       help_table,             NULL,   gnumeric_table,
                        gnumeric_table_link,
                        NULL, GNM_FUNC_SIMPLE + GNM_FUNC_INTERNAL,
                        GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC,
diff --git a/src/func.c b/src/func.c
index 350e617..6a82392 100644
--- a/src/func.c
+++ b/src/func.c
@@ -78,6 +78,11 @@ functions_shutdown (void)
        functions_by_localized_name = NULL;
 }
 
+/**
+ * gnm_func_enumerate:
+ *
+ * Return value: (element-type GnmFunc) (transfer container):
+ */
 GPtrArray *
 gnm_func_enumerate (void)
 {
diff --git a/src/sstest.c b/src/sstest.c
index 33ba43a..2f4ab0c 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -273,22 +273,23 @@ static GPtrArray *
 enumerate_functions (gboolean filter)
 {
        GPtrArray *res = gnm_func_enumerate ();
+       unsigned ui;
 
-       if (filter) {
-               unsigned ui;
-               for (ui = 0; ui < res->len; ui++) {
-                       GnmFunc *fd = g_ptr_array_index (res, ui);
-
-                       if (fd->name == NULL ||
-                           strcmp (fd->name, "perl_adder") == 0 ||
-                           strcmp (fd->name, "perl_date") == 0 ||
-                           strcmp (fd->name, "perl_sed") == 0 ||
-                           strcmp (fd->name, "py_capwords") == 0 ||
-                           strcmp (fd->name, "py_printf") == 0 ||
-                           strcmp (fd->name, "py_bitand") == 0) {
-                               g_ptr_array_remove_index_fast (res, ui);
-                               ui--;
-                       }
+       for (ui = 0; ui < res->len; ui++) {
+               GnmFunc *fd = g_ptr_array_index (res, ui);
+
+               gnm_func_load_if_stub (fd);
+
+               if (filter &&
+                   (fd->name == NULL ||
+                    strcmp (fd->name, "perl_adder") == 0 ||
+                    strcmp (fd->name, "perl_date") == 0 ||
+                    strcmp (fd->name, "perl_sed") == 0 ||
+                    strcmp (fd->name, "py_capwords") == 0 ||
+                    strcmp (fd->name, "py_printf") == 0 ||
+                    strcmp (fd->name, "py_bitand") == 0)) {
+                       g_ptr_array_remove_index_fast (res, ui);
+                       ui--;
                }
        }
 
@@ -3495,6 +3496,8 @@ main (int argc, char const **argv)
                /* FIXME: What do we want to do here? */
                go_error_info_free (plugin_errs);
        }
+       g_object_unref (cc);
+       cc = NULL;
 
        if (func_state_file) {
                function_dump_defs (func_state_file, 0);
@@ -3526,7 +3529,6 @@ main (int argc, char const **argv)
 
        /* ---------------------------------------- */
 
-       g_object_unref (cc);
        gnm_shutdown ();
        gnm_pre_parse_shutdown ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]