[gnumeric] Avoid unncessary sheet specification in analysis tools. [#691892]



commit afe30fb67929771b47023ed2b441afe15a94bb05
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Jan 24 14:43:51 2013 -0700

    Avoid unncessary sheet specification in analysis tools. [#691892]
    
    2013-01-24  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dao.c (dao_get_cellref_full): new
    	(dao_get_cellref): use dao_get_cellref_full
    	(dao_get_rangeref_full): new
    	(dao_get_rangeref): use dao_get_cellref_full
    
    2013-01-24  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* functions.c (help_normsdist): use correct technical term
    	(help_normsinv): use correct technical term

 NEWS                        |    1 +
 plugins/fn-stat/ChangeLog   |    5 +++++
 plugins/fn-stat/functions.c |    4 ++--
 src/tools/ChangeLog         |    7 +++++++
 src/tools/dao.c             |   25 ++++++++++++++++++-------
 5 files changed, 33 insertions(+), 9 deletions(-)
---
diff --git a/NEWS b/NEWS
index b1e4830..a809d10 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Andreas:
 	* Some documentation fixes.
 	* Show argument names for python functions. [#690681]
 	* Fix loading of ODF files with named expressions. [#690925]
+	* Avoid unncessary sheet specification in analysis tools. [#691892]
 
 Jean:
 	* Fixed aspect ratio for graph sheets. [#691472]
diff --git a/plugins/fn-stat/ChangeLog b/plugins/fn-stat/ChangeLog
index b8224c3..8ed28cd 100644
--- a/plugins/fn-stat/ChangeLog
+++ b/plugins/fn-stat/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-24  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* functions.c (help_normsdist): use correct technical term
+	(help_normsinv): use correct technical term
+
 2013-01-03  Morten Welinder  <terra gnome org>
 
 	* functions.c (gnumeric_count, gnumeric_counta): Make this regular
diff --git a/plugins/fn-stat/functions.c b/plugins/fn-stat/functions.c
index eedbece..c63f2b0 100644
--- a/plugins/fn-stat/functions.c
+++ b/plugins/fn-stat/functions.c
@@ -436,7 +436,7 @@ gnumeric_negbinomdist (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_normsdist[] = {
-	{ GNM_FUNC_HELP_NAME, F_("NORMSDIST:cumulative density function of the standard normal distribution")},
+	{ GNM_FUNC_HELP_NAME, F_("NORMSDIST:cumulative distribution function of the standard normal distribution")},
 	{ GNM_FUNC_HELP_ARG, F_("x:number")},
 	{ GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
 	{ GNM_FUNC_HELP_ODF, F_("NORMSDIST is the OpenFormula function LEGACY.NORMSDIST.") },
@@ -460,7 +460,7 @@ gnumeric_normsdist (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_normsinv[] = {
-	{ GNM_FUNC_HELP_NAME, F_("NORMSINV:inverse of the cumulative density function of the standard normal distribution")},
+	{ GNM_FUNC_HELP_NAME, F_("NORMSINV:inverse of the cumulative distribution function of the standard normal distribution")},
 	{ GNM_FUNC_HELP_ARG, F_("p:given probability")},
 	{ GNM_FUNC_HELP_NOTE, F_("If @{p} < 0 or @{p} > 1 this function returns #NUM! error.")},
 	{ GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index 165bf66..d6d6253 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-24  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* dao.c (dao_get_cellref_full): new
+	(dao_get_cellref): use dao_get_cellref_full
+	(dao_get_rangeref_full): new
+	(dao_get_rangeref): use dao_get_cellref_full
+
 2013-01-17  Morten Welinder  <terra gnome org>
 
 	* analysis-tools.c (analysis_tool_regression_engine_run): Simplify
diff --git a/src/tools/dao.c b/src/tools/dao.c
index 27c7a2d..22e1fe5 100644
--- a/src/tools/dao.c
+++ b/src/tools/dao.c
@@ -1114,11 +1114,11 @@ dao_redraw_respan (data_analysis_output_t *dao)
 }
 
 
-GnmExpr const  *
-dao_get_cellref (data_analysis_output_t *dao, int x, int y)
+static GnmExpr const  *
+dao_get_cellref_full (data_analysis_output_t *dao, int x, int y, Sheet *sheet)
 {
 	GnmCellRef r;
-	r.sheet = dao->sheet;
+	r.sheet = sheet;
 	r.col = x + dao->start_col + dao->offset_col;
 	r.col_relative = FALSE;
 	r.row = y + dao->start_row + dao->offset_row;
@@ -1127,19 +1127,25 @@ dao_get_cellref (data_analysis_output_t *dao, int x, int y)
 }
 
 GnmExpr const  *
-dao_get_rangeref (data_analysis_output_t *dao, int ax, int ay,  int bx, int by)
+dao_get_cellref (data_analysis_output_t *dao, int x, int y)
+{
+	return dao_get_cellref_full (dao, x, y, NULL);
+}
+
+static GnmExpr const  *
+dao_get_rangeref_full (data_analysis_output_t *dao, int ax, int ay,  int bx, int by, Sheet *sheet)
 {
 	GnmValue *v;
 	GnmCellRef ar;
 	GnmCellRef br;
 
-	ar.sheet = dao->sheet;
+	ar.sheet = sheet;
 	ar.col = ax + dao->start_col + dao->offset_col;
 	ar.col_relative = FALSE;
 	ar.row = ay + dao->start_row + dao->offset_row;
 	ar.row_relative = FALSE;
 
-	br.sheet = dao->sheet;
+	br.sheet = sheet;
 	br.col = bx + dao->start_col + dao->offset_col;
 	br.col_relative = FALSE;
 	br.row = by + dao->start_row + dao->offset_row;
@@ -1149,6 +1155,11 @@ dao_get_rangeref (data_analysis_output_t *dao, int ax, int ay,  int bx, int by)
 	return gnm_expr_new_constant (v);
 }
 
+GnmExpr const  *
+dao_get_rangeref (data_analysis_output_t *dao, int ax, int ay,  int bx, int by)
+{
+	return dao_get_rangeref_full (dao, ax, ay, bx, by, NULL);
+}
 
 void
 dao_set_sheet_object (data_analysis_output_t *dao, int col, int row, SheetObject* so)
@@ -1187,7 +1198,7 @@ dao_set_sheet_object (data_analysis_output_t *dao, int col, int row, SheetObject
 GOData	*
 dao_go_data_vector (data_analysis_output_t *dao, int ax, int ay,  int bx, int by)
 {
-	return gnm_go_data_vector_new_expr (dao->sheet, gnm_expr_top_new (dao_get_rangeref (dao, ax, ay, bx, by)));
+	return gnm_go_data_vector_new_expr (dao->sheet, gnm_expr_top_new (dao_get_rangeref_full (dao, ax, ay, bx, by, dao->sheet)));
 }
 
 /**



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