[gnumeric] Fix weighted and Spencer moving averages crashes. [#645722]



commit bd4530b3628d90ba1d74606905ad24988ef01042
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Mar 24 18:19:57 2011 -0600

    Fix weighted and Spencer moving averages crashes. [#645722]
    
    2011-03-24 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* analysis-tools.c (analysis_tool_moving_average_engine_run): load
    	fd_index for all situations when will need it.

 NEWS                       |    1 +
 src/tools/ChangeLog        |    5 +++++
 src/tools/analysis-tools.c |    3 ++-
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 4c47c04..80e538c 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Andreas:
 	* Fix import of dbf files with more than 65536 rows. [#644189]
 	* Export workbook-scoped named expressions and ranges to ODF.
 	* Improve reading of named expressions from ODF files. 
+	* Fix weighted and Spencer moving averages crashes. [#645722]
 
 Jean:
 	* Fix cursor position inside a cell edited in a zoomed sheet. [#641709]
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index cc1b88b..0ea4681 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-24 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* analysis-tools.c (analysis_tool_moving_average_engine_run): load
+	fd_index for all situations when will need it.
+
 2011-02-26  Morten Welinder  <terra gnome org>
 
 	* gnm-solver.c (gnm_solver_constraint_valid): Fix typo.  (Part of
diff --git a/src/tools/analysis-tools.c b/src/tools/analysis-tools.c
index a6252f7..8e03fd7 100644
--- a/src/tools/analysis-tools.c
+++ b/src/tools/analysis-tools.c
@@ -3704,7 +3704,8 @@ analysis_tool_moving_average_engine_run (data_analysis_output_t *dao,
 	SheetObject *so = NULL;
 	GogPlot	     *plot = NULL;
 
-	if (info->base.labels) {
+	if (info->base.labels || info->ma_type == moving_average_type_wma
+	    || info->ma_type== moving_average_type_spencer_ma) {
 		fd_index = gnm_func_lookup_or_add_placeholder ("INDEX", dao->sheet ? dao->sheet->workbook : NULL, FALSE);
 		gnm_func_ref (fd_index);
 	}



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