Commit 72fc0fde authored by Michael Meeks's avatar Michael Meeks

I lied, sort out the function translation hash cache.

parent 89ede02a
1999-07-01 Michael Meeks <michael@edenproject.org>
* src/main.c (gnumeric_main): Added excel_shutdown.
1999-07-01 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/datefuns.xls: Added a few missing function tests.
......
1999-07-01 Michael Meeks <michael@edenproject.org>
* src/main.c (gnumeric_main): Added excel_shutdown.
1999-07-01 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/datefuns.xls: Added a few missing function tests.
......
1999-07-01 Michael Meeks <michael@edenproject.org>
* src/main.c (gnumeric_main): Added excel_shutdown.
1999-07-01 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/datefuns.xls: Added a few missing function tests.
......
1999-07-01 Michael Meeks <michael@edenproject.org>
* src/main.c (gnumeric_main): Added excel_shutdown.
1999-07-01 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/datefuns.xls: Added a few missing function tests.
......
1999-07-01 Michael Meeks <michael@edenproject.org>
* ms-formula-write.c (ms_formula_cache_init),
(ms_formula_cache_shutdown, cache_remove):
Implemented.
* excel.h: Added formula_cache functions.
* boot.h (excel_init): Added excel_shutdown
* boot.c (excel_shutdown): Created.
1999-07-01 Michael Meeks <michael@edenproject.org>
* ms-formula-write.c (write_string): Created
......@@ -8,7 +20,7 @@
* ms-excel-write.h: Added type to specify string write.
* ms-formula-write.c: All bif_put_text's write length
* ms-formula-write.c: All biff_put_text's write length
correctly.
Implemented Area PTGs
......
......@@ -117,9 +117,17 @@ excel_init (void)
char *descr2 = _("Excel(R) 97 file format");
char *descr3 = _("Excel(R) 95 file format");
ms_formula_cache_init ();
/* We register Excel format with a precendence of 100 */
file_format_register_open (100, descr, excel_probe, excel_load);
if (gnumeric_debugging > 0)
file_format_register_save (".xls", descr2, excel_save_98);
file_format_register_save (".xls", descr3, excel_save_95);
}
void
excel_shutdown (void)
{
ms_formula_cache_shutdown ();
}
void excel_init (void);
extern void excel_init (void);
extern void excel_shutdown (void);
......@@ -41,4 +41,7 @@ typedef struct
extern FormulaFuncData formula_func_data[];
#define FORMULA_FUNC_DATA_LEN 368
extern void ms_formula_cache_init (void);
extern void ms_formula_cache_shutdown (void);
#endif
......@@ -32,6 +32,27 @@ typedef struct {
/* Lookup Name -> integer */
static GHashTable *formula_cache = NULL;
void
ms_formula_cache_init (void)
{
formula_cache = g_hash_table_new (g_str_hash, g_str_equal);
}
static gboolean
cache_remove (gchar *name, FormulaCacheEntry *fce, void *dummy)
{
g_free (fce);
return TRUE;
}
void
ms_formula_cache_shutdown (void)
{
g_hash_table_foreach_remove (formula_cache, (GHRFunc)cache_remove,
NULL);
g_hash_table_destroy (formula_cache);
}
static FormulaCacheEntry *
get_formula_index (const gchar *name)
{
......@@ -39,9 +60,7 @@ get_formula_index (const gchar *name)
FormulaCacheEntry *fce;
g_return_val_if_fail (name, NULL);
if (!formula_cache)
formula_cache = g_hash_table_new (g_str_hash, g_str_equal);
g_return_val_if_fail (formula_cache, NULL);
if ((fce = g_hash_table_lookup (formula_cache, name))) {
#if FORMULA_DEBUG > 0
......
......@@ -94,6 +94,7 @@ gnumeric_main (void *closure, int argc, char *argv [])
gtk_main ();
excel_shutdown ();
cursors_shutdown ();
format_match_finish ();
format_color_shutdown ();
......
......@@ -94,6 +94,7 @@ gnumeric_main (void *closure, int argc, char *argv [])
gtk_main ();
excel_shutdown ();
cursors_shutdown ();
format_match_finish ();
format_color_shutdown ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment