Commit 1018dd24 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

http://bugzilla.gnome.org/show_bug.cgi?id=163414 "If it hurts when you do



2005-06-14  Jody Goldberg <jody@gnome.org>

	http://bugzilla.gnome.org/show_bug.cgi?id=163414
	* src/item-bar.c (item_bar_event) : "If it hurts when you do that,
	  don't do that".  Position the tooltip above the cursor for row
	  headers too :-)

2005-06-13  Jody Goldberg <jody@gnome.org>

	* functions.c (gnumeric_column) : rework to handle arrays locally.
	(gnumeric_row) : ditto.

2005-06-13  Jody Goldberg <jody@gnome.org>

	* src/expr.c (gnm_expr_eval) : when evaluating an array pass the
	  cols/rows into the EvalPos.

	* src/position.c (eval_pos_init) : init new cols/rows member
	(eval_pos_init_dep) : ditto.
	(eval_pos_init_cell) : ditto.
	(eval_pos_init_sheet) : ditto.
parent d63a1322
......@@ -286,6 +286,7 @@ Architecture Changes
Target Features
---------------
- validation from list (generalize filter combos)
- add column selector to autofilter filter dialog ala OOo
- insert cut
- clipboard handlers in plugins
- input message (Stored)
......
2005-06-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=163414
* src/item-bar.c (item_bar_event) : "If it hurts when you do that,
don't do that". Position the tooltip above the cursor for row
headers too :-)
2005-06-20 Morten Welinder <terra@gnome.org>
* src/commands.c (cmd_rename_sheet): Prevent renames to "".
......@@ -11,6 +18,16 @@
(cb_handlebox_visible): Make changes to visibility permanent.
(wbc_gtk_init): Don't set everything visible.
2005-06-13 Jody Goldberg <jody@gnome.org>
* src/expr.c (gnm_expr_eval) : when evaluating an array pass the
cols/rows into the EvalPos.
* src/position.c (eval_pos_init) : init new cols/rows member
(eval_pos_init_dep) : ditto.
(eval_pos_init_cell) : ditto.
(eval_pos_init_sheet) : ditto.
2005-06-13 Jody Goldberg <jody@gnome.org>
* configure.in : post release bump
......
Gnumeric 1.5.3
Jody:
* Handle ROW/COLUMN with no argument in an array.
* Fix problems with row height resizing on win32. [#163414]
Morten:
* Make changes to toolbar visibility permanent.
* Fix stf export quoting problem. [#308109]
......
2005-06-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=163414
* src/item-bar.c (item_bar_event) : "If it hurts when you do that,
don't do that". Position the tooltip above the cursor for row
headers too :-)
2005-06-20 Morten Welinder <terra@gnome.org>
* src/commands.c (cmd_rename_sheet): Prevent renames to "".
......@@ -11,6 +18,16 @@
(cb_handlebox_visible): Make changes to visibility permanent.
(wbc_gtk_init): Don't set everything visible.
2005-06-13 Jody Goldberg <jody@gnome.org>
* src/expr.c (gnm_expr_eval) : when evaluating an array pass the
cols/rows into the EvalPos.
* src/position.c (eval_pos_init) : init new cols/rows member
(eval_pos_init_dep) : ditto.
(eval_pos_init_cell) : ditto.
(eval_pos_init_sheet) : ditto.
2005-06-13 Jody Goldberg <jody@gnome.org>
* configure.in : post release bump
......
2005-06-13 Jody Goldberg <jody@gnome.org>
* functions.c (gnumeric_column) : rework to handle arrays locally.
As far as we know these are the only position dependent situations
for arrays.
(gnumeric_row) : ditto.
2005-06-13 Jody Goldberg <jody@gnome.org>
* Release 1.5.2
......
......@@ -33,6 +33,7 @@
#include <str.h>
#include <sheet.h>
#include <value.h>
#include <ranges.h>
#include <expr.h>
#include <expr-impl.h>
#include <expr-impl.h>
......@@ -951,35 +952,33 @@ static GnmFuncHelp const help_column[] = {
static GnmValue *
gnumeric_column (FunctionEvalInfo *ei, GnmValue const * const *args)
{
int col, width, height, i, j;
GnmValue *res;
GnmValue const *ref = args[0];
if (!ref)
return value_new_int (ei->pos->eval.col + 1);
switch (ref->type) {
case VALUE_CELLRANGE: {
int width = value_area_get_width (ref, ei->pos);
int height = value_area_get_height (ref, ei->pos);
GnmCellRef const *const refa = &ref->v_range.cell.a;
int col = cellref_get_abs_col (refa, ei->pos) + 1;
int i, j;
GnmValue *res;
if (width == 1 && height == 1)
return value_new_int (col);
res = value_new_array (width, height);
for (i = width - 1; i >= 0 ; --i)
for (j = height - 1 ; j >= 0 ; --j)
value_array_set (res, i, j,
value_new_int (col + i));
return res;
}
if (ref == NULL) {
col = ei->pos->eval.col + 1; /* user visible counts from 0 */
width = ei->pos->cols;
height= ei->pos->rows;
} else if (ref->type == VALUE_CELLRANGE) {
Sheet *tmp;
GnmRange r;
rangeref_normalize (&ref->v_range.cell, ei->pos, &tmp, &tmp, &r);
col = r.start.col + 1;
width = range_width (&r);
height = range_height (&r);
} else
return value_new_error_VALUE (ei->pos);
default: /* Nothing */ ;
}
if (width == 1 && height == 1)
return value_new_int (col);
return value_new_error_VALUE (ei->pos);
res = value_new_array (width, height);
for (i = width; i-- > 0 ; )
for (j = height ; j-- > 0 ; )
value_array_set (res, i, j, value_new_int (col + i));
return res;
}
/***************************************************************************/
......@@ -1131,35 +1130,33 @@ static GnmFuncHelp const help_row[] = {
static GnmValue *
gnumeric_row (FunctionEvalInfo *ei, GnmValue const * const *args)
{
int row, width, height, i, j;
GnmValue *res;
GnmValue const *ref = args[0];
if (!ref)
return value_new_int (ei->pos->eval.row + 1);
switch (ref->type) {
case VALUE_CELLRANGE: {
int width = value_area_get_width (ref, ei->pos);
int height = value_area_get_height (ref, ei->pos);
GnmCellRef const *const refa = &ref->v_range.cell.a;
int row = cellref_get_abs_row (refa, ei->pos) + 1;
int i, j;
GnmValue *res;
if (width == 1 && height == 1)
return value_new_int (row);
res = value_new_array (width, height);
for (i = width - 1; i >= 0 ; --i)
for (j = height - 1 ; j >= 0 ; --j)
value_array_set (res, i, j,
value_new_int (row + j));
return res;
}
if (ref == NULL) {
row = ei->pos->eval.row + 1; /* user visible counts from 0 */
width = ei->pos->cols;
height= ei->pos->rows;
} else if (ref->type == VALUE_CELLRANGE) {
Sheet *tmp;
GnmRange r;
rangeref_normalize (&ref->v_range.cell, ei->pos, &tmp, &tmp, &r);
row = r.start.row + 1;
width = range_width (&r);
height = range_height (&r);
} else
return value_new_error_VALUE (ei->pos);
default: /* Nothing */ ;
}
if (width == 1 && height == 1)
return value_new_int (row);
return value_new_error_VALUE (ei->pos);
res = value_new_array (width, height);
for (j = height ; j-- > 0 ; )
for (i = width; i-- > 0 ; )
value_array_set (res, i, j, value_new_int (row + j));
return res;
}
/***************************************************************************/
......
......@@ -1316,12 +1316,16 @@ gnm_expr_eval (GnmExpr const *expr, GnmEvalPos const *pos,
int x = expr->array.x;
int y = expr->array.y;
if (x == 0 && y == 0) {
GnmEvalPos range_pos = *pos;
range_pos.cols = expr->array.cols;
range_pos.rows = expr->array.rows;
/* Release old value if necessary */
a = expr->array.corner.value;
if (a != NULL)
value_release (a);
a = gnm_expr_eval (expr->array.corner.expr, pos,
a = gnm_expr_eval (expr->array.corner.expr, &range_pos,
flags | GNM_EXPR_EVAL_PERMIT_NON_SCALAR);
/* Store real result (cast away const)*/
......
......@@ -971,7 +971,13 @@ item_bar_event (FooCanvasItem *item, GdkEvent *e)
if (ib->tip == NULL) {
ib->tip = gnumeric_create_tooltip ();
colrow_tip_setlabel (ib, is_cols, ib->colrow_resize_size);
gnumeric_position_tooltip (ib->tip, is_cols);
/* Position above the current point for both
* col and row headers. trying to put it
* beside for row headers often ends up pushing
* the tip under the cursor which can have odd
* effects on the event stream. win32 was
* different from X. */
gnumeric_position_tooltip (ib->tip, TRUE);
gtk_widget_show_all (gtk_widget_get_toplevel (ib->tip));
}
} else {
......
......@@ -41,6 +41,7 @@ eval_pos_init (GnmEvalPos *ep, Sheet *sheet, GnmCellPos const *pos)
ep->sheet = sheet;
ep->eval = *pos;
ep->cols = ep->rows = 1;
ep->dep = NULL;
return ep;
......@@ -60,6 +61,7 @@ eval_pos_init_dep (GnmEvalPos *ep, GnmDependent const *dep)
static GnmCellPos const pos = { 0, 0 };
ep->eval = pos;
}
ep->cols = ep->rows = 1;
return ep;
}
......@@ -69,9 +71,10 @@ eval_pos_init_cell (GnmEvalPos *ep, GnmCell const *cell)
g_return_val_if_fail (ep != NULL, NULL);
g_return_val_if_fail (cell != NULL, NULL);
ep->dep = (GnmDependent *)CELL_TO_DEP (cell);
ep->dep = (GnmDependent *)CELL_TO_DEP (cell);
ep->sheet = cell->base.sheet;
ep->eval = cell->pos;
ep->eval = cell->pos;
ep->cols = ep->rows = 1;
return ep;
}
......@@ -83,9 +86,10 @@ eval_pos_init_sheet (GnmEvalPos *ep, Sheet *sheet)
g_return_val_if_fail (ep != NULL, NULL);
g_return_val_if_fail (IS_SHEET (sheet), NULL);
ep->dep = NULL;
ep->dep = NULL;
ep->sheet = sheet;
ep->eval = pos;
ep->eval = pos;
ep->cols = ep->rows = 1;
return ep;
}
......
......@@ -4,9 +4,10 @@
#include "gnumeric.h"
struct _GnmEvalPos {
GnmCellPos eval;
Sheet *sheet;
GnmDependent *dep; /* optionally NULL */
GnmCellPos eval;
int cols, rows; /* for arrays */
Sheet *sheet;
GnmDependent *dep; /* optionally NULL */
};
struct _GnmParsePos {
......
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