[gnumeric] Fucns: new CONCAT function.



commit cb2344495051f17f35ce5ad657d2dda1d28d25e3
Author: Morten Welinder <terra gnome org>
Date:   Thu Aug 4 09:20:57 2016 -0400

    Fucns: new CONCAT function.
    
    This is an alias of CONCATENATE.  Excel docs hint at some difference
    that may or may not apply to us.  Defining an alias is fairly cheap
    and facilitates import from both Excel formats and LO.

 NEWS                            |    4 +
 doc/C/func.defs                 | 6674 ------------
 doc/C/functions.xml             |22685 ---------------------------------------
 plugins/fn-string/functions.c   |   32 +-
 plugins/fn-string/plugin.xml.in |    1 +
 5 files changed, 31 insertions(+), 29365 deletions(-)
---
diff --git a/NEWS b/NEWS
index 1d17d43..8dd1a88 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ Andreas:
 Jean:
        * Fix  paradox plugin build with pxlib-0.6.7. [#769319]
 
+Morten:
+       * Avoid gnome-common dependency.
+       * New function CONCAT.
+
 --------------------------------------------------------------------------
 Gnumeric 1.12.31
 
diff --git a/plugins/fn-string/functions.c b/plugins/fn-string/functions.c
index dce78a4..c627065 100644
--- a/plugins/fn-string/functions.c
+++ b/plugins/fn-string/functions.c
@@ -601,13 +601,13 @@ gnumeric_upper (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_concatenate[] = {
-        { GNM_FUNC_HELP_NAME, F_("CONCATENATE:the concatenation of the strings @{s1}, @{s2},\xe2\x80\xa6")},
-        { GNM_FUNC_HELP_ARG, F_("s1:first string")},
-        { GNM_FUNC_HELP_ARG, F_("s2:second string")},
+       { GNM_FUNC_HELP_NAME, F_("CONCATENATE:the concatenation of the strings @{s1}, @{s2},\xe2\x80\xa6")},
+       { GNM_FUNC_HELP_ARG, F_("s1:first string")},
+       { GNM_FUNC_HELP_ARG, F_("s2:second string")},
        { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
-        { GNM_FUNC_HELP_EXAMPLES, "=CONCATENATE(\"aa\",\"bb\")" },
-        { GNM_FUNC_HELP_SEEALSO, "LEFT,MID,RIGHT"},
-        { GNM_FUNC_HELP_END}
+       { GNM_FUNC_HELP_EXAMPLES, "=CONCATENATE(\"aa\",\"bb\")" },
+       { GNM_FUNC_HELP_SEEALSO, "LEFT,MID,RIGHT"},
+       { GNM_FUNC_HELP_END}
 };
 
 
@@ -620,6 +620,23 @@ gnumeric_concatenate (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv
                                      GNM_ERROR_VALUE);
 }
 
+static GnmFuncHelp const help_concat[] = {
+       { GNM_FUNC_HELP_NAME, F_("CONCAT:the concatenation of the strings @{s1}, @{s2},\xe2\x80\xa6")},
+       { GNM_FUNC_HELP_ARG, F_("s1:first string")},
+       { GNM_FUNC_HELP_ARG, F_("s2:second string")},
+       { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+       { GNM_FUNC_HELP_EXAMPLES, "=CONCAT(\"aa\",\"bb\")" },
+       { GNM_FUNC_HELP_NOTE, F_("This function is identical to CONCATENATE") },
+       { GNM_FUNC_HELP_SEEALSO, "LEFT,MID,RIGHT"},
+       { GNM_FUNC_HELP_END}
+};
+
+static GnmValue *
+gnumeric_concat (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
+{
+       return gnumeric_concatenate (ei, argc, argv);
+}
+
 /***************************************************************************/
 
 static GnmFuncHelp const help_rept[] = {
@@ -1673,6 +1690,9 @@ GnmFuncDescriptor const string_functions[] = {
         { "unicode",    "S",                         help_unicode,
          gnumeric_unicode, NULL, NULL, NULL,
          GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_BASIC },
+        { "concat", NULL,               help_concat,
+         NULL, gnumeric_concat, NULL, NULL,
+         GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_BASIC },
         { "concatenate", NULL,               help_concatenate,
          NULL, gnumeric_concatenate, NULL, NULL,
          GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_BASIC },
diff --git a/plugins/fn-string/plugin.xml.in b/plugins/fn-string/plugin.xml.in
index 652cd71..342822a 100644
--- a/plugins/fn-string/plugin.xml.in
+++ b/plugins/fn-string/plugin.xml.in
@@ -15,6 +15,7 @@
                                <function name="char"/>
                                <function name="clean"/>
                                <function name="code"/>
+                               <function name="concat"/>
                                <function name="concatenate"/>
                                <function name="dollar"/>
                                <function name="exact"/>


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