[gnumeric] add f.inv to xls import and xlsx import/export



commit 7645e90c88d7a8860fc17741dcc082f40e7b683b
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri Jun 21 19:15:08 2013 -0600

    add f.inv to xls import and xlsx import/export
    
    2013-06-21  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * ms-formula-read.c (ms-formula-read.c): add
        "f.inv" --> "r.qf"
        * xlsx-utils.c (xlsx_func_finv_output_handler): new
        (xlsx_conventions_new): connect new handler and add
        "f.inv" --> "r.qf" translation

 plugins/excel/ChangeLog         |    8 ++++++++
 plugins/excel/ms-formula-read.c |    1 +
 plugins/excel/xlsx-utils.c      |   17 ++++++++++++++++-
 3 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index dced50c..dcf27ba 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,6 +1,14 @@
 2013-06-21  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * ms-formula-read.c (ms-formula-read.c): add
+       "f.inv" --> "r.qf"
+       * xlsx-utils.c (xlsx_func_finv_output_handler): new
+       (xlsx_conventions_new): connect new handler and add
+       "f.inv" --> "r.qf" translation
+
+2013-06-21  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * ms-formula-read.c (ms-formula-read.c): add
        "chisq.inv" --> "r.qchisq"
        * xlsx-utils.c (xlsx_func_chisqinv_output_handler): new
        (xlsx_conventions_new): connect new handler and add
diff --git a/plugins/excel/ms-formula-read.c b/plugins/excel/ms-formula-read.c
index fda34e1..23a4145 100644
--- a/plugins/excel/ms-formula-read.c
+++ b/plugins/excel/ms-formula-read.c
@@ -488,6 +488,7 @@ xl2010_synonyms (const char *name)
                { "covariance.p", "covar" },
                { "expon.dist", "expondist" },
                { "f.dist.rt", "fdist" },
+               { "f.inv", "r.qf" },
                { "f.inv.rt", "finv" },
                { "f.test", "ftest" },
                { "gamma.dist", "gammadist" },
diff --git a/plugins/excel/xlsx-utils.c b/plugins/excel/xlsx-utils.c
index 8229a92..9c379ec 100644
--- a/plugins/excel/xlsx-utils.c
+++ b/plugins/excel/xlsx-utils.c
@@ -232,7 +232,7 @@ static gboolean
 xlsx_func_chisqinv_output_handler (GnmConventionsOut *out, GnmExprFunction const *func)
 /* R.QCHISQ(a,b) --> CHISQ.INV(a,b) */
 {
-       if (func->argc == 3) {
+       if (func->argc == 2) {
                GString *target = out->accum;
                g_string_append (target, "_xlfn.CHISQ.INV");
                gnm_expr_list_as_string (func->argc, func->argv, out);
@@ -241,6 +241,19 @@ xlsx_func_chisqinv_output_handler (GnmConventionsOut *out, GnmExprFunction const
        return FALSE;
 }
 
+static gboolean
+xlsx_func_finv_output_handler (GnmConventionsOut *out, GnmExprFunction const *func)
+/* R.QF(a,b,c) --> F.INV(a,b,c) */
+{
+       if (func->argc == 3) {
+               GString *target = out->accum;
+               g_string_append (target, "_xlfn.F.INV");
+               gnm_expr_list_as_string (func->argc, func->argv, out);
+               return TRUE;
+       }
+       return FALSE;
+}
+
 
 GnmConventions *
 xlsx_conventions_new (gboolean output)
@@ -259,6 +272,7 @@ xlsx_conventions_new (gboolean output)
        } const xlfn_func_output_handlers[] = {
                {"R.QBINOM", xlsx_func_binominv_output_handler},
                {"R.QCHISQ", xlsx_func_chisqinv_output_handler},
+               {"R.QF", xlsx_func_finv_output_handler},
                {NULL, NULL}
        };
        
@@ -277,6 +291,7 @@ xlsx_conventions_new (gboolean output)
                { "COVARIANCE.P", "COVAR" },
                { "EXPON.DIST", "EXPONDIST" },
                { "F.DIST.RT", "FDIST" },
+               { "F.INV", "R.QF" }, /* see output handler */
                { "F.INV.RT", "FINV" },
                { "F.TEST", "FTEST" },
                { "GAMMA.DIST", "GAMMADIST" },


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