[gnumeric] gnm_func_lookup_prefix: ignore internal functions.



commit fa923d6597710c188ce176e3d70ca58b0d93b383
Author: Morten Welinder <terra gnome org>
Date:   Wed Jun 6 20:23:34 2018 -0400

    gnm_func_lookup_prefix: ignore internal functions.

 src/func.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/func.c b/src/func.c
index f3e18baef..452cd65fa 100644
--- a/src/func.c
+++ b/src/func.c
@@ -585,7 +585,8 @@ gnm_func_lookup_localized (char const *name, Workbook *scope)
  * @scope:
  * @trans: whether to search translated function names
  *
- * Returns: (element-type GnmFunc*) (transfer full):
+ * Returns: (element-type GnmFunc*) (transfer full): A list of functions
+ * whose names start with @prefix.
  **/
 GSList *
 gnm_func_lookup_prefix (char const *prefix, Workbook *scope, gboolean trans)
@@ -601,7 +602,7 @@ gnm_func_lookup_prefix (char const *prefix, Workbook *scope, gboolean trans)
        g_hash_table_iter_init (&hiter, functions_by_name);
        while (g_hash_table_iter_next (&hiter, NULL, &value)) {
                GnmFunc *fd = value;
-               if (!(fd->flags & GNM_FUNC_IS_PLACEHOLDER)) {
+               if (!(fd->flags & (GNM_FUNC_IS_PLACEHOLDER | GNM_FUNC_INTERNAL))) {
                        const char *name = gnm_func_get_name (fd, trans);
                        if (g_str_has_prefix (name, prefix)) {
                                gnm_func_inc_usage (fd);


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