Commit ddc5bfd2 authored by Morten Welinder's avatar Morten Welinder
Browse files

Fix scrolling bug. Minor cleanup of new root finder.

Fix scrolling bug.
Minor cleanup of new root finder.
parent 596d0c11
1999-05-23 Morten Welinder <terra@diku.dk>
* src/gnumeric-sheet.c (gnumeric_sheet_cursor_set): Make the
scroll bar reflect the top-left corner's position. This feels
more natural.
(gnumeric_sheet_set_top_col): Compute visible ranges; do nothing
until things change.
(gnumeric_sheet_set_top_row): Ditto.
* src/dialog-goal-seek.c (gnumeric_goal_seek): Use
goal_seek_initialise.
(gnumeric_goal_seek): Trawl heavier and earlier in the middle.
(dialog_goal_seek): downcase a stray uppercase letter.
* src/goal-seek.c (goal_seek_initialise): New function.
1999-05-23 Morten Welinder <terra@diku.dk> 1999-05-23 Morten Welinder <terra@diku.dk>
* src/dialog-goal-seek.c: redesign non-gui part. * src/dialog-goal-seek.c: redesign non-gui part.
......
1999-05-23 Morten Welinder <terra@diku.dk>
* src/gnumeric-sheet.c (gnumeric_sheet_cursor_set): Make the
scroll bar reflect the top-left corner's position. This feels
more natural.
(gnumeric_sheet_set_top_col): Compute visible ranges; do nothing
until things change.
(gnumeric_sheet_set_top_row): Ditto.
* src/dialog-goal-seek.c (gnumeric_goal_seek): Use
goal_seek_initialise.
(gnumeric_goal_seek): Trawl heavier and earlier in the middle.
(dialog_goal_seek): downcase a stray uppercase letter.
* src/goal-seek.c (goal_seek_initialise): New function.
1999-05-23 Morten Welinder <terra@diku.dk> 1999-05-23 Morten Welinder <terra@diku.dk>
* src/dialog-goal-seek.c: redesign non-gui part. * src/dialog-goal-seek.c: redesign non-gui part.
......
1999-05-23 Morten Welinder <terra@diku.dk>
* src/gnumeric-sheet.c (gnumeric_sheet_cursor_set): Make the
scroll bar reflect the top-left corner's position. This feels
more natural.
(gnumeric_sheet_set_top_col): Compute visible ranges; do nothing
until things change.
(gnumeric_sheet_set_top_row): Ditto.
* src/dialog-goal-seek.c (gnumeric_goal_seek): Use
goal_seek_initialise.
(gnumeric_goal_seek): Trawl heavier and earlier in the middle.
(dialog_goal_seek): downcase a stray uppercase letter.
* src/goal-seek.c (goal_seek_initialise): New function.
1999-05-23 Morten Welinder <terra@diku.dk> 1999-05-23 Morten Welinder <terra@diku.dk>
* src/dialog-goal-seek.c: redesign non-gui part. * src/dialog-goal-seek.c: redesign non-gui part.
......
1999-05-23 Morten Welinder <terra@diku.dk>
* src/gnumeric-sheet.c (gnumeric_sheet_cursor_set): Make the
scroll bar reflect the top-left corner's position. This feels
more natural.
(gnumeric_sheet_set_top_col): Compute visible ranges; do nothing
until things change.
(gnumeric_sheet_set_top_row): Ditto.
* src/dialog-goal-seek.c (gnumeric_goal_seek): Use
goal_seek_initialise.
(gnumeric_goal_seek): Trawl heavier and earlier in the middle.
(dialog_goal_seek): downcase a stray uppercase letter.
* src/goal-seek.c (goal_seek_initialise): New function.
1999-05-23 Morten Welinder <terra@diku.dk> 1999-05-23 Morten Welinder <terra@diku.dk>
* src/dialog-goal-seek.c: redesign non-gui part. * src/dialog-goal-seek.c: redesign non-gui part.
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "utils.h" #include "utils.h"
#include "goal-seek.h" #include "goal-seek.h"
#ifdef HAVE_IEEEFP_H #ifdef HAVE_IEEEFP_H
# include <ieeefp.h> #include <ieeefp.h>
#endif #endif
#define MAX_CELL_NAME_LEN 20 #define MAX_CELL_NAME_LEN 20
...@@ -70,10 +70,9 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet, ...@@ -70,10 +70,9 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet,
GoalEvalData evaldata; GoalEvalData evaldata;
GoalSeekStatus status; GoalSeekStatus status;
goal_seek_initialise (&seekdata);
seekdata.xmin = xmin; seekdata.xmin = xmin;
seekdata.xmax = xmax; seekdata.xmax = xmax;
seekdata.precision = 1e-10;
seekdata.havexpos = seekdata.havexneg = FALSE;
evaldata.xcell = change_cell; evaldata.xcell = change_cell;
evaldata.ycell = set_cell; evaldata.ycell = set_cell;
...@@ -105,31 +104,31 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet, ...@@ -105,31 +104,31 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet,
goto DONE; goto DONE;
} }
/* PLAN C: Trawl normally from left. */ /* PLAN C: Trawl normally from middle. */
{ {
float_t sigma, mu; float_t sigma, mu;
int i; int i;
sigma = seekdata.xmax - seekdata.xmin; sigma = seekdata.xmax - seekdata.xmin;
mu = seekdata.xmin; mu = (seekdata.xmax + seekdata.xmin) / 2;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
sigma /= 10; sigma /= 10;
status = goal_seek_trawl_normally (goal_seek_eval, status = goal_seek_trawl_normally (goal_seek_eval,
&seekdata, &evaldata, &seekdata, &evaldata,
mu, sigma, 20); mu, sigma, 30);
if (status == GOAL_SEEK_OK) if (status == GOAL_SEEK_OK)
goto DONE; goto DONE;
} }
} }
/* PLAN D: Trawl normally from right. */ /* PLAN D: Trawl normally from left. */
{ {
float_t sigma, mu; float_t sigma, mu;
int i; int i;
sigma = seekdata.xmax - seekdata.xmin; sigma = seekdata.xmax - seekdata.xmin;
mu = seekdata.xmax; mu = seekdata.xmin;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
sigma /= 10; sigma /= 10;
...@@ -141,13 +140,13 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet, ...@@ -141,13 +140,13 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet,
} }
} }
/* PLAN E: Trawl normally from middle. */ /* PLAN E: Trawl normally from right. */
{ {
float_t sigma, mu; float_t sigma, mu;
int i; int i;
sigma = seekdata.xmax - seekdata.xmin; sigma = seekdata.xmax - seekdata.xmin;
mu = (seekdata.xmax + seekdata.xmin) / 2; mu = seekdata.xmax;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
sigma /= 10; sigma /= 10;
...@@ -279,17 +278,17 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet) ...@@ -279,17 +278,17 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet)
xmin_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN); xmin_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN);
xmax_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN); xmax_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN);
set_label = gtk_label_new (_("Set Cell:")); set_label = gtk_label_new (_("Set cell:"));
target_label = gtk_label_new (_("To value:")); target_label = gtk_label_new (_("To value:"));
change_label = gtk_label_new (_("By changing cell:")); change_label = gtk_label_new (_("By changing cell:"));
xmin_label = gtk_label_new (_("To a value of at least [optional]:")); xmin_label = gtk_label_new (_("To a value of at least [optional]:"));
xmax_label = gtk_label_new (_("But no bigger than [optional]:")); xmax_label = gtk_label_new (_("But no bigger than [optional]:"));
gtk_misc_set_alignment (GTK_MISC(set_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (set_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(target_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (target_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(change_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (change_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(xmin_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (xmin_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(xmax_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (xmax_label), 0, 0);
box = gtk_hbox_new (FALSE, 0); box = gtk_hbox_new (FALSE, 0);
entry_box = gtk_vbox_new (FALSE, 0); entry_box = gtk_vbox_new (FALSE, 0);
...@@ -312,18 +311,12 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet) ...@@ -312,18 +311,12 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet)
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG
(dialog)->vbox), box); (dialog)->vbox), box);
gtk_entry_set_text(GTK_ENTRY (set_entry), set_entry_str); gtk_entry_set_text (GTK_ENTRY (set_entry), set_entry_str);
gtk_entry_set_position(GTK_ENTRY (set_entry), 0); focus_on_entry (set_entry);
gtk_entry_select_region(GTK_ENTRY (set_entry), 0,
GTK_ENTRY(set_entry)->text_length);
gtk_widget_show_all (box); gtk_widget_show_all (box);
} else { } else {
gtk_entry_set_text(GTK_ENTRY (set_entry), set_entry_str); gtk_entry_set_text (GTK_ENTRY (set_entry), set_entry_str);
gtk_entry_set_position(GTK_ENTRY (set_entry), 0); focus_on_entry (set_entry);
gtk_entry_select_region(GTK_ENTRY (set_entry), 0,
GTK_ENTRY(set_entry)->text_length);
gtk_widget_show (dialog); gtk_widget_show (dialog);
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "utils.h" #include "utils.h"
#include "goal-seek.h" #include "goal-seek.h"
#ifdef HAVE_IEEEFP_H #ifdef HAVE_IEEEFP_H
# include <ieeefp.h> #include <ieeefp.h>
#endif #endif
#define MAX_CELL_NAME_LEN 20 #define MAX_CELL_NAME_LEN 20
...@@ -70,10 +70,9 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet, ...@@ -70,10 +70,9 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet,
GoalEvalData evaldata; GoalEvalData evaldata;
GoalSeekStatus status; GoalSeekStatus status;
goal_seek_initialise (&seekdata);
seekdata.xmin = xmin; seekdata.xmin = xmin;
seekdata.xmax = xmax; seekdata.xmax = xmax;
seekdata.precision = 1e-10;
seekdata.havexpos = seekdata.havexneg = FALSE;
evaldata.xcell = change_cell; evaldata.xcell = change_cell;
evaldata.ycell = set_cell; evaldata.ycell = set_cell;
...@@ -105,31 +104,31 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet, ...@@ -105,31 +104,31 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet,
goto DONE; goto DONE;
} }
/* PLAN C: Trawl normally from left. */ /* PLAN C: Trawl normally from middle. */
{ {
float_t sigma, mu; float_t sigma, mu;
int i; int i;
sigma = seekdata.xmax - seekdata.xmin; sigma = seekdata.xmax - seekdata.xmin;
mu = seekdata.xmin; mu = (seekdata.xmax + seekdata.xmin) / 2;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
sigma /= 10; sigma /= 10;
status = goal_seek_trawl_normally (goal_seek_eval, status = goal_seek_trawl_normally (goal_seek_eval,
&seekdata, &evaldata, &seekdata, &evaldata,
mu, sigma, 20); mu, sigma, 30);
if (status == GOAL_SEEK_OK) if (status == GOAL_SEEK_OK)
goto DONE; goto DONE;
} }
} }
/* PLAN D: Trawl normally from right. */ /* PLAN D: Trawl normally from left. */
{ {
float_t sigma, mu; float_t sigma, mu;
int i; int i;
sigma = seekdata.xmax - seekdata.xmin; sigma = seekdata.xmax - seekdata.xmin;
mu = seekdata.xmax; mu = seekdata.xmin;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
sigma /= 10; sigma /= 10;
...@@ -141,13 +140,13 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet, ...@@ -141,13 +140,13 @@ gnumeric_goal_seek (Workbook *wb, Sheet *sheet,
} }
} }
/* PLAN E: Trawl normally from middle. */ /* PLAN E: Trawl normally from right. */
{ {
float_t sigma, mu; float_t sigma, mu;
int i; int i;
sigma = seekdata.xmax - seekdata.xmin; sigma = seekdata.xmax - seekdata.xmin;
mu = (seekdata.xmax + seekdata.xmin) / 2; mu = seekdata.xmax;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
sigma /= 10; sigma /= 10;
...@@ -279,17 +278,17 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet) ...@@ -279,17 +278,17 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet)
xmin_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN); xmin_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN);
xmax_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN); xmax_entry = gtk_entry_new_with_max_length (MAX_CELL_NAME_LEN);
set_label = gtk_label_new (_("Set Cell:")); set_label = gtk_label_new (_("Set cell:"));
target_label = gtk_label_new (_("To value:")); target_label = gtk_label_new (_("To value:"));
change_label = gtk_label_new (_("By changing cell:")); change_label = gtk_label_new (_("By changing cell:"));
xmin_label = gtk_label_new (_("To a value of at least [optional]:")); xmin_label = gtk_label_new (_("To a value of at least [optional]:"));
xmax_label = gtk_label_new (_("But no bigger than [optional]:")); xmax_label = gtk_label_new (_("But no bigger than [optional]:"));
gtk_misc_set_alignment (GTK_MISC(set_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (set_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(target_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (target_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(change_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (change_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(xmin_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (xmin_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC(xmax_label), 0, 0); gtk_misc_set_alignment (GTK_MISC (xmax_label), 0, 0);
box = gtk_hbox_new (FALSE, 0); box = gtk_hbox_new (FALSE, 0);
entry_box = gtk_vbox_new (FALSE, 0); entry_box = gtk_vbox_new (FALSE, 0);
...@@ -312,18 +311,12 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet) ...@@ -312,18 +311,12 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet)
gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG
(dialog)->vbox), box); (dialog)->vbox), box);
gtk_entry_set_text(GTK_ENTRY (set_entry), set_entry_str); gtk_entry_set_text (GTK_ENTRY (set_entry), set_entry_str);
gtk_entry_set_position(GTK_ENTRY (set_entry), 0); focus_on_entry (set_entry);
gtk_entry_select_region(GTK_ENTRY (set_entry), 0,
GTK_ENTRY(set_entry)->text_length);
gtk_widget_show_all (box); gtk_widget_show_all (box);
} else { } else {
gtk_entry_set_text(GTK_ENTRY (set_entry), set_entry_str); gtk_entry_set_text (GTK_ENTRY (set_entry), set_entry_str);
gtk_entry_set_position(GTK_ENTRY (set_entry), 0); focus_on_entry (set_entry);
gtk_entry_select_region(GTK_ENTRY (set_entry), 0,
GTK_ENTRY(set_entry)->text_length);
gtk_widget_show (dialog); gtk_widget_show (dialog);
} }
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include "cursors.h" #include "cursors.h"
#include "utils.h" #include "utils.h"
#undef DEBUG_POSITIONS
#define CURSOR_COL(gsheet) (gsheet)->sheet_view->sheet->cursor_col #define CURSOR_COL(gsheet) (gsheet)->sheet_view->sheet->cursor_col
#define CURSOR_ROW(gsheet) (gsheet)->sheet_view->sheet->cursor_row #define CURSOR_ROW(gsheet) (gsheet)->sheet_view->sheet->cursor_row
...@@ -29,7 +31,7 @@ gnumeric_sheet_destroy (GtkObject *object) ...@@ -29,7 +31,7 @@ gnumeric_sheet_destroy (GtkObject *object)
/* Add shutdown code here */ /* Add shutdown code here */
gsheet = GNUMERIC_SHEET (object); gsheet = GNUMERIC_SHEET (object);
if (GTK_OBJECT_CLASS (sheet_parent_class)->destroy) if (GTK_OBJECT_CLASS (sheet_parent_class)->destroy)
(*GTK_OBJECT_CLASS (sheet_parent_class)->destroy)(object); (*GTK_OBJECT_CLASS (sheet_parent_class)->destroy)(object);
} }
...@@ -39,7 +41,7 @@ gnumeric_sheet_create (SheetView *sheet_view, GtkWidget *entry) ...@@ -39,7 +41,7 @@ gnumeric_sheet_create (SheetView *sheet_view, GtkWidget *entry)
{ {
GnumericSheet *gsheet; GnumericSheet *gsheet;
GnomeCanvas *canvas; GnomeCanvas *canvas;
gsheet = gtk_type_new (gnumeric_sheet_get_type ()); gsheet = gtk_type_new (gnumeric_sheet_get_type ());
canvas = GNOME_CANVAS (gsheet); canvas = GNOME_CANVAS (gsheet);
...@@ -47,7 +49,7 @@ gnumeric_sheet_create (SheetView *sheet_view, GtkWidget *entry) ...@@ -47,7 +49,7 @@ gnumeric_sheet_create (SheetView *sheet_view, GtkWidget *entry)
gsheet->top_col = 0; gsheet->top_col = 0;
gsheet->top_row = 0; gsheet->top_row = 0;
gsheet->entry = entry; gsheet->entry = entry;
return gsheet; return gsheet;
} }
...@@ -55,12 +57,12 @@ void ...@@ -55,12 +57,12 @@ void
gnumeric_sheet_get_cell_bounds (GnumericSheet *gsheet, int col, int row, int *x, int *y, int *w, int *h) gnumeric_sheet_get_cell_bounds (GnumericSheet *gsheet, int col, int row, int *x, int *y, int *w, int *h)
{ {
Sheet *sheet; Sheet *sheet;
g_return_if_fail (gsheet != NULL); g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet)); g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
sheet = gsheet->sheet_view->sheet; sheet = gsheet->sheet_view->sheet;
*x = sheet_col_get_distance (sheet, gsheet->top_col, col); *x = sheet_col_get_distance (sheet, gsheet->top_col, col);
*y = sheet_row_get_distance (sheet, gsheet->top_row, row); *y = sheet_row_get_distance (sheet, gsheet->top_row, row);
...@@ -82,7 +84,7 @@ gnumeric_sheet_cursor_set (GnumericSheet *gsheet, int col, int row) ...@@ -82,7 +84,7 @@ gnumeric_sheet_cursor_set (GnumericSheet *gsheet, int col, int row)
{ {
GtkAdjustment *ha, *va; GtkAdjustment *ha, *va;
SheetView *sheet_view; SheetView *sheet_view;
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet)); g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
sheet_view = gsheet->sheet_view; sheet_view = gsheet->sheet_view;
...@@ -90,12 +92,23 @@ gnumeric_sheet_cursor_set (GnumericSheet *gsheet, int col, int row) ...@@ -90,12 +92,23 @@ gnumeric_sheet_cursor_set (GnumericSheet *gsheet, int col, int row)
if (sheet_view->ha){ if (sheet_view->ha){
ha = GTK_ADJUSTMENT (sheet_view->ha); ha = GTK_ADJUSTMENT (sheet_view->ha);
va = GTK_ADJUSTMENT (sheet_view->va); va = GTK_ADJUSTMENT (sheet_view->va);
ha->value = col; ha->value = gsheet->top_col;
va->value = row; va->value = gsheet->top_row;
#ifdef DEBUG_POSITIONS
{
char *top_str = g_strdup (cell_name (gsheet->top_col, gsheet->top_row));
char *lv_str = g_strdup (cell_name (gsheet->last_visible_col, gsheet->last_visible_row));
printf ("top=%s lv=%s\n", top_str, lv_str);
g_free (top_str);
g_free (lv_str);
}
#endif
gtk_adjustment_value_changed (ha); gtk_adjustment_value_changed (ha);
gtk_adjustment_value_changed (va); gtk_adjustment_value_changed (va);
} }
} }
/* /*
...@@ -184,14 +197,14 @@ move_cursor_horizontal (GnumericSheet *gsheet, int count) ...@@ -184,14 +197,14 @@ move_cursor_horizontal (GnumericSheet *gsheet, int count)
{ {
Sheet *sheet = gsheet->sheet_view->sheet; Sheet *sheet = gsheet->sheet_view->sheet;
int new_left; int new_left;
new_left = sheet->cursor_col + count; new_left = sheet->cursor_col + count;
if (new_left < 0) if (new_left < 0)
new_left = 0; new_left = 0;
if (new_left > SHEET_MAX_COLS-1) if (new_left > SHEET_MAX_COLS-1)
new_left = SHEET_MAX_COLS-1; new_left = SHEET_MAX_COLS-1;
move_cursor (gsheet, new_left, sheet->cursor_row, TRUE); move_cursor (gsheet, new_left, sheet->cursor_row, TRUE);
} }
...@@ -214,7 +227,7 @@ move_cursor_vertical (GnumericSheet *gsheet, int count) ...@@ -214,7 +227,7 @@ move_cursor_vertical (GnumericSheet *gsheet, int count)
new_top = 0; new_top = 0;
if (new_top > SHEET_MAX_ROWS-1) if (new_top > SHEET_MAX_ROWS-1)
new_top = SHEET_MAX_ROWS-1; new_top = SHEET_MAX_ROWS-1;
move_cursor (gsheet, sheet->cursor_col, new_top, TRUE); move_cursor (gsheet, sheet->cursor_col, new_top, TRUE);
} }
...@@ -249,25 +262,25 @@ gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet) ...@@ -249,25 +262,25 @@ gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet)
if (!gsheet->sheet_view->sheet->editing) if (!gsheet->sheet_view->sheet->editing)
return FALSE; return FALSE;
if (gsheet->item_editor && gsheet->selecting_cell) if (gsheet->item_editor && gsheet->selecting_cell)
return TRUE; return TRUE;
entry = GTK_ENTRY (gsheet->entry); entry = GTK_ENTRY (gsheet->entry);
cursor_pos = GTK_EDITABLE (entry)->current_pos; cursor_pos = GTK_EDITABLE (entry)->current_pos;
if (entry->text [0] != '=') if (entry->text [0] != '=')
return FALSE; return FALSE;
if (cursor_pos == 0) if (cursor_pos == 0)
return FALSE; return FALSE;