Commit 19d8291c authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Implement.

2004-10-07  Morten Welinder  <terra@gnome.org>

	* src/cmd-edit.c (sv_select_cur_inputs): Implement.

	* src/expr.c (gnm_expr_get_ranges): Implement.
parent 79a35d3c
2004-10-07 Morten Welinder <terra@gnome.org>
* src/cmd-edit.c (sv_select_cur_inputs): Implement.
* src/expr.c (gnm_expr_get_ranges): Implement.
2004-10-06 Jon K Hellan <hellan@acm.org>
* src/workbook-control-gui.c (show_gui): Maximize when preferred
......
Gnumeric 1.3.92
Morten:
* Implement Edit->Select->Input. [#154735]
--------------------------------------------------------------------------
Gnumeric 1.3.91
Adrian:
......
2004-10-07 Morten Welinder <terra@gnome.org>
* src/cmd-edit.c (sv_select_cur_inputs): Implement.
* src/expr.c (gnm_expr_get_ranges): Implement.
2004-10-06 Jon K Hellan <hellan@acm.org>
* src/workbook-control-gui.c (show_gui): Maximize when preferred
......
......@@ -39,6 +39,7 @@
#include "ranges.h"
#include "commands.h"
#include "clipboard.h"
#include "value.h"
#include <gtk/gtk.h>
......@@ -244,8 +245,8 @@ void
sv_select_cur_inputs (SheetView *sv)
{
GnmCell *cell;
GnmRange *r;
GSList *ranges, *ptr;
GnmEvalPos ep;
g_return_if_fail (IS_SHEET_VIEW (sv));
......@@ -257,17 +258,32 @@ sv_select_cur_inputs (SheetView *sv)
if (ranges == NULL)
return;
#if 0
ep.eval = sv->edit_pos;
ep.sheet = sv->sheet;
ep.dep = NULL;
sv_selection_reset (sv);
for (ptr = ranges ; ptr != NULL ; ptr = ptr->next)
for (ptr = ranges ; ptr != NULL ; ptr = ptr->next) {
GnmValue *v = ptr->data;
GnmRangeRef const *r = value_get_rangeref (v);
#warning "FIXME: What do we do in these 3D cases?"
if (r->a.sheet != r->b.sheet)
continue;
if (r->a.sheet != NULL && r->a.sheet != sv->sheet)
continue;
sv_selection_add_range (sv,
r->start.col, r->start.row,
r->start.col, r->start.row,
r->end.col, r->end.row);
cellref_get_abs_col (&r->a, &ep),
cellref_get_abs_row (&r->a, &ep),
cellref_get_abs_col (&r->a, &ep),
cellref_get_abs_row (&r->a, &ep),
cellref_get_abs_col (&r->b, &ep),
cellref_get_abs_row (&r->b, &ep));
value_release (v);
}
g_slist_free (ranges);
#endif
/* TODO : finish this */
sheet_update (sv->sheet);
}
......
......@@ -2334,6 +2334,48 @@ gnm_expr_get_range (GnmExpr const *expr)
}
}
static GSList *
do_gnm_expr_get_ranges (GnmExpr const *expr, GSList *ranges)
{
switch (expr->any.oper) {
case GNM_EXPR_OP_RANGE_CTOR:
case GNM_EXPR_OP_INTERSECT:
case GNM_EXPR_OP_ANY_BINARY:
return do_gnm_expr_get_ranges (
expr->binary.value_a,
do_gnm_expr_get_ranges (
expr->binary.value_b,
ranges));
case GNM_EXPR_OP_ANY_UNARY:
return do_gnm_expr_get_ranges (expr->unary.value, ranges);
case GNM_EXPR_OP_FUNCALL: {
GnmExprList *l;
for (l = expr->func.arg_list; l; l = l->next)
ranges = do_gnm_expr_get_ranges (l->data, ranges);
return ranges;
}
case GNM_EXPR_OP_SET: {
GnmExprList *l;
for (l = expr->set.set; l; l = l->next)
ranges = do_gnm_expr_get_ranges (l->data, ranges);
return ranges;
}
case GNM_EXPR_OP_NAME:
/* What? */
default: {
GnmValue *v = gnm_expr_get_range (expr);
if (v)
return g_slist_insert_unique (ranges, v);
return ranges;
}
}
}
/**
* gnm_expr_get_ranges:
* @expr :
......@@ -2345,25 +2387,8 @@ gnm_expr_get_range (GnmExpr const *expr)
GSList *
gnm_expr_get_ranges (GnmExpr const *expr)
{
GHashTable *singles, *ranges;
g_return_val_if_fail (expr != NULL, NULL);
switch (expr->any.oper) {
case GNM_EXPR_OP_CELLREF :
return NULL;
case GNM_EXPR_OP_CONSTANT:
return NULL;
case GNM_EXPR_OP_NAME:
if (!expr->name.name->active)
return NULL;
return NULL;
default:
return NULL;
}
return do_gnm_expr_get_ranges (expr, NULL);
}
/**
......
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