[gnumeric] TABLE: fix interaction with collect.c



commit 28562fbe741e6f9b704cc2fea22ff2faaf88f96b
Author: Morten Welinder <terra gnome org>
Date:   Mon May 17 19:34:44 2010 -0400

    TABLE: fix interaction with collect.c

 ChangeLog          |   13 +++++++++----
 NEWS               |    1 +
 src/func-builtin.c |   14 +++++++++++++-
 3 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index be6017c..af34f2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-17  Morten Welinder  <terra gnome org>
+
+	* src/func-builtin.c (gnumeric_table): Fix interactin with
+	collect.c in a hacky way.
+
 2010-05-17  Jean Brefort  <jean brefort normalesup org>
 
 	* src/item-cursor.c (item_cursor_in_drag_handle),
@@ -19,7 +24,7 @@
 2010-05-04 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/colrow.h (_ColRowInfo): add in_advanced_filter field
-	* src/wbc-gtk-actions.c (actions): make it clear that ShowAll 
+	* src/wbc-gtk-actions.c (actions): make it clear that ShowAll
 	  relates to Advanced Filters
 	* src/wbc-gtk.c (wbcg_menu_state_update): keep has_filtered_rows
 	  for advanced filters separate from the auto filters.
@@ -30,7 +35,7 @@
 	* src/wbc-gtk.c (wbcg_menu_state_update): use MS_FILTER_STATE_CHANGED
 	  rather than MS_CONSOLIDATE
 	* src/workbook-control.h (MS_FILTER_STATE_CHANGED): new
-	
+
 2010-05-03  Morten Welinder  <terra gnome org>
 
 	* src/style.c (gnm_pango_context_get): Cache the context.  (Some
@@ -128,7 +133,7 @@
 2010-04-21 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* gnumeric.doap: add e-mail address
-	* src/print.c (print_page): graphs on graph sheets always take 
+	* src/print.c (print_page): graphs on graph sheets always take
 	  the whole space, no need to center
 
 2010-04-21  Morten Welinder  <terra gnome org>
@@ -205,7 +210,7 @@
 
 	* src/gnumeric-gconf.c (set_string_list): since go_conf_set_str_list
 	  may trigger cb_watch_string_list that uses string_list_pool, we need
-	  to fix the hash table first. 
+	  to fix the hash table first.
 
 2010-03-23  Morten Welinder  <terra gnome org>
 
diff --git a/NEWS b/NEWS
index 838894f..a40f8e6 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Jean:
 
 Morten:
 	* Linear regression test suite.
+	* Fix TABLE problem.  [#618829]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.3
diff --git a/src/func-builtin.c b/src/func-builtin.c
index e230e47..5d5e517 100644
--- a/src/func-builtin.c
+++ b/src/func-builtin.c
@@ -33,7 +33,7 @@
 #include <expr-impl.h>
 #include <sheet.h>
 #include <cell.h>
-#include <cell.h>
+#include <application.h>
 
 /***************************************************************************/
 
@@ -144,6 +144,14 @@ gnumeric_table_link (GnmFuncEvalInfo *ei)
 	return DEPENDENT_IGNORE_ARGS;
 }
 
+static void
+void_calculation_caches (void)
+{
+	/* A CRUDE, CRUDE way of killing collect.c's caches.  */
+	g_signal_emit_by_name (gnm_app_get_app (), "recalc-finished");
+}
+
+
 static GnmValue *
 gnumeric_table (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
 {
@@ -201,10 +209,12 @@ gnumeric_table (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
 			gnm_cell_eval (x_iter);
 			in[0]->value = value_dup (x_iter->value);
 			dependent_queue_recalc (&in[0]->base);
+			void_calculation_caches ();
 		} else
 			val[0] = value_dup (x_iter->value);
 
 		for (y = ei->pos->array->rows ; y-- > 0 ; ) {
+			g_signal_emit_by_name (gnm_app_get_app (), "recalc-finished");
 			y_iter = sheet_cell_get (ei->pos->sheet,
 				ei->pos->eval.col-1, y + ei->pos->eval.row);
 			if (NULL == y_iter)
@@ -214,6 +224,7 @@ gnumeric_table (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
 				/* not a leak, val[] holds the original */
 				in[1]->value = value_dup (y_iter->value);
 				dependent_queue_recalc (&in[1]->base);
+				void_calculation_caches ();
 				if (NULL != in[0]) {
 					gnm_cell_eval (in[2]);
 					value_array_set (res, x, y, value_dup (in[2]->value));
@@ -249,6 +260,7 @@ gnumeric_table (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
 				sheet_cell_remove (ei->pos->sheet, in[x], FALSE, FALSE);
 				in[x] = NULL;
 			}
+			void_calculation_caches ();
 		}
 	for (x = 0 ; x < 3 ; x++)
 		if (in[x])



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