[gnumeric] xls: fix import of IFERROR function.



commit 9f7c563976832518c8bdd637bf47fbcb25d6afec
Author: Morten Welinder <terra gnome org>
Date:   Tue Apr 9 13:03:39 2013 -0400

    xls: fix import of IFERROR function.

 NEWS                            |    1 +
 plugins/excel/ChangeLog         |    5 +++++
 plugins/excel/ms-formula-read.c |    5 +++++
 3 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index a8a2e8a..3b357f2 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Morten:
        * Fix problems with R.PSNORM.  [#697293]
        * New function OWENT.
        * New function POCHHAMMER.
+       * Fix import of IFERROR from xls.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.1
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 8c99abd..4a512d7 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-09  Morten Welinder  <terra gnome org>
+
+       * ms-formula-read.c (make_function): Fix importing of IFERROR and
+       perhaps other newer functions.
+
 2013-03-09  Morten Welinder <terra gnome org>
 
        * Release 1.12.1
diff --git a/plugins/excel/ms-formula-read.c b/plugins/excel/ms-formula-read.c
index 92273ab..f668330 100644
--- a/plugins/excel/ms-formula-read.c
+++ b/plugins/excel/ms-formula-read.c
@@ -657,6 +657,11 @@ make_function (GnmExprList **stack, int fn_idx, int numargs, Workbook *wb)
                        return FALSE;
                }
 
+               /* This happens for IFERROR */
+               if (g_str_has_prefix (f_name, "_xlfn.") &&
+                   gnm_func_lookup (f_name + 6, wb))
+                       f_name += 6;
+
                name = gnm_func_lookup (f_name, wb);
                d (2, g_printerr ("Function '%s' of %d args\n",
                               f_name, numargs););


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