Commit e5d027e2 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Removed unused variables

1998-10-01  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/item-grid.c (item_grid_event): Removed unused variables

	* src/gnumeric-sheet.c (gnumeric_sheet_start_cell_selection,
	gnumeric_sheet_selection_extend,
	gnumeric_sheet_selection_cursor_place): New routines for letting
	the user use the mouse to select a cell range.  Invoked from
	item-grid.c

	* src/item-grid.c (item_grid_event): Clean and reorgranize the
	event handler, remove unused variables.

	* src/gnumeric-sheet.c (selection_expand_horizontal): -1 now means
	"shrink the selection", which means Left/Up keys shrink.
	Right/Down expand.
	(selection_expand_vertical): likewise.

	* src/format.c (format_number): Fixed memory leak: this is a
	pretty bad construction: g_string_append (s, alloc_string()).  I
	just did not see it coming.  Taking metal note of this.

	* src/number-match.c (format_create_regexp): Fixed memory leaks.
	The strings returned by create_option_list need to be released.

	* src/style.c (style_color_new): Important bug fix:  The key I was
	passing was a GdkColor, but our hash table stored StyleColors
	inside.

	* src/format.c (append_year): Better fix, suggested by Morten
	Welinder <terra@diku.dk>
parent d2a56e24
1998-10-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-grid.c (item_grid_event): Removed unused variables
* src/gnumeric-sheet.c (gnumeric_sheet_start_cell_selection,
gnumeric_sheet_selection_extend,
gnumeric_sheet_selection_cursor_place): New routines for letting
the user use the mouse to select a cell range. Invoked from
item-grid.c
* src/item-grid.c (item_grid_event): Clean and reorgranize the
event handler, remove unused variables.
* src/gnumeric-sheet.c (selection_expand_horizontal): -1 now means
"shrink the selection", which means Left/Up keys shrink.
Right/Down expand.
(selection_expand_vertical): likewise.
* src/format.c (format_number): Fixed memory leak: this is a
pretty bad construction: g_string_append (s, alloc_string()). I
just did not see it coming. Taking metal note of this.
* src/number-match.c (format_create_regexp): Fixed memory leaks.
The strings returned by create_option_list need to be released.
* src/style.c (style_color_new): Important bug fix: The key I was
passing was a GdkColor, but our hash table stored StyleColors
inside.
* src/format.c (append_year): Better fix, suggested by Morten
Welinder <terra@diku.dk>
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (clipboard_export_cell_region): Correct fix to
......
1998-10-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-grid.c (item_grid_event): Removed unused variables
* src/gnumeric-sheet.c (gnumeric_sheet_start_cell_selection,
gnumeric_sheet_selection_extend,
gnumeric_sheet_selection_cursor_place): New routines for letting
the user use the mouse to select a cell range. Invoked from
item-grid.c
* src/item-grid.c (item_grid_event): Clean and reorgranize the
event handler, remove unused variables.
* src/gnumeric-sheet.c (selection_expand_horizontal): -1 now means
"shrink the selection", which means Left/Up keys shrink.
Right/Down expand.
(selection_expand_vertical): likewise.
* src/format.c (format_number): Fixed memory leak: this is a
pretty bad construction: g_string_append (s, alloc_string()). I
just did not see it coming. Taking metal note of this.
* src/number-match.c (format_create_regexp): Fixed memory leaks.
The strings returned by create_option_list need to be released.
* src/style.c (style_color_new): Important bug fix: The key I was
passing was a GdkColor, but our hash table stored StyleColors
inside.
* src/format.c (append_year): Better fix, suggested by Morten
Welinder <terra@diku.dk>
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (clipboard_export_cell_region): Correct fix to
......
1998-10-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-grid.c (item_grid_event): Removed unused variables
* src/gnumeric-sheet.c (gnumeric_sheet_start_cell_selection,
gnumeric_sheet_selection_extend,
gnumeric_sheet_selection_cursor_place): New routines for letting
the user use the mouse to select a cell range. Invoked from
item-grid.c
* src/item-grid.c (item_grid_event): Clean and reorgranize the
event handler, remove unused variables.
* src/gnumeric-sheet.c (selection_expand_horizontal): -1 now means
"shrink the selection", which means Left/Up keys shrink.
Right/Down expand.
(selection_expand_vertical): likewise.
* src/format.c (format_number): Fixed memory leak: this is a
pretty bad construction: g_string_append (s, alloc_string()). I
just did not see it coming. Taking metal note of this.
* src/number-match.c (format_create_regexp): Fixed memory leaks.
The strings returned by create_option_list need to be released.
* src/style.c (style_color_new): Important bug fix: The key I was
passing was a GdkColor, but our hash table stored StyleColors
inside.
* src/format.c (append_year): Better fix, suggested by Morten
Welinder <terra@diku.dk>
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (clipboard_export_cell_region): Correct fix to
......
1998-10-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-grid.c (item_grid_event): Removed unused variables
* src/gnumeric-sheet.c (gnumeric_sheet_start_cell_selection,
gnumeric_sheet_selection_extend,
gnumeric_sheet_selection_cursor_place): New routines for letting
the user use the mouse to select a cell range. Invoked from
item-grid.c
* src/item-grid.c (item_grid_event): Clean and reorgranize the
event handler, remove unused variables.
* src/gnumeric-sheet.c (selection_expand_horizontal): -1 now means
"shrink the selection", which means Left/Up keys shrink.
Right/Down expand.
(selection_expand_vertical): likewise.
* src/format.c (format_number): Fixed memory leak: this is a
pretty bad construction: g_string_append (s, alloc_string()). I
just did not see it coming. Taking metal note of this.
* src/number-match.c (format_create_regexp): Fixed memory leaks.
The strings returned by create_option_list need to be released.
* src/style.c (style_color_new): Important bug fix: The key I was
passing was a GdkColor, but our hash table stored StyleColors
inside.
* src/format.c (append_year): Better fix, suggested by Morten
Welinder <terra@diku.dk>
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (clipboard_export_cell_region): Correct fix to
......
......@@ -2,6 +2,13 @@
GNOME Spread Sheet task list
* Number formatting
The formatting code should take the current GtkFont for the cell
being formatted as well as the width allowed and take this into
account to render the number as well as possible given the space so
that for small regions, numbers in scientific notation are displayed.
* Sheet
* Auditing
......
......@@ -6,6 +6,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <locale.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "eval.h"
......@@ -298,7 +299,7 @@ cell_set_text_simple (Cell *cell, char *text)
case 'E': case 'e': case '+': case ':': case '.': case ',':
if (*p == ',' || *p == '.')
if (lconv->decimal_point != *p){
if (*lconv->decimal_point != *p){
is_text = TRUE;
break;
}
......
......@@ -85,6 +85,7 @@ void cell_set_format (Cell *cell, char *format);
void cell_set_format_simple (Cell *cell, char *format);
void cell_set_font (Cell *cell, char *font_name);
void cell_set_style (Cell *cell, Style *reference_style);
void cell_set_comment (Cell *cell, char *str);
void cell_set_font_from_style (Cell *cell, StyleFont *style_font);
void cell_set_foreground (Cell *cell, gushort red, gushort green, gushort blue);
void cell_set_background (Cell *cell, gushort red, gushort green, gushort blue);
......
/*
* expr.c: Expression evaluation in Gnumeriuc
*
* Author:
* Miguel de Icaza (miguel@gnu.org).
*/
#include <config.h>
#include <gnome.h>
#include <math.h>
......
......@@ -90,10 +90,7 @@ append_year (GString *string, gchar *format, struct tm *time_split)
}
if (format [2] != 'y' || format [3] != 'y'){
if (time_split->tm_year > 99)
sprintf (temp, "%04d", time_split + 1900);
else
sprintf (temp, "%02d", time_split->tm_year);
sprintf (temp, "%02d", time_split->tm_year % 100);
g_string_append (string, temp);
return 2;
}
......@@ -926,8 +923,12 @@ format_number (gdouble number, StyleFormatEntry *style_format_entry)
}
format++;
}
if (!info.rendered && can_render_number)
g_string_append (result, do_render_number (number, &info));
if (!info.rendered && can_render_number){
char *rendered_string = do_render_number (number, &info);
g_string_append (result, rendered_string);
g_free (rendered_string);
}
finish:
res = g_strdup (result->str);
g_string_free (result, TRUE);
......
......@@ -242,7 +242,7 @@ move_vertical_selection (GnumericSheet *gsheet, int count)
* a cell range (if the cursor is in a spot in the expression
* where it makes sense to have a cell reference), false if not.
*/
static int
int
gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet)
{
GtkEntry *entry = GTK_ENTRY (gsheet->entry);
......@@ -267,7 +267,7 @@ gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet)
}
static void
start_cell_selection (GnumericSheet *gsheet)
start_cell_selection_at (GnumericSheet *gsheet, int col, int row)
{
GnomeCanvas *canvas = GNOME_CANVAS (gsheet);
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (canvas->root);
......@@ -282,19 +282,40 @@ start_cell_selection (GnumericSheet *gsheet)
"Sheet", gsheet->sheet_view->sheet,
"Grid", gsheet->item_grid,
"Style", ITEM_CURSOR_ANTED, NULL));
item_cursor_set_bounds (ITEM_CURSOR (gsheet->selection),
sheet->cursor_col,
sheet->cursor_row,
sheet->cursor_col,
sheet->cursor_row);
gsheet->selection->base_col = col;
gsheet->selection->base_row = row;
item_cursor_set_bounds (ITEM_CURSOR (gsheet->selection), col, row, col, row);
gsheet->sel_cursor_pos = GTK_EDITABLE (gsheet->entry)->current_pos;
gsheet->sel_text_len = 0;
}
static void
stop_cell_selection (GnumericSheet *gsheet)
start_cell_selection (GnumericSheet *gsheet)
{
Sheet *sheet = gsheet->sheet_view->sheet;
start_cell_selection_at (gsheet, sheet->cursor_col, sheet->cursor_row);
}
void
gnumeric_sheet_start_cell_selection (GnumericSheet *gsheet, int col, int row)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
if (gsheet->selecting_cell)
return;
start_cell_selection_at (gsheet, col, row);
}
void
gnumeric_sheet_stop_cell_selection (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
if (!gsheet->selecting_cell)
return;
......@@ -342,7 +363,7 @@ gnumeric_sheet_destroy_editing_cursor (GnumericSheet *gsheet)
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
stop_cell_selection (gsheet);
gnumeric_sheet_stop_cell_selection (gsheet);
if (!gsheet->item_editor)
return;
......@@ -396,6 +417,53 @@ selection_insert_selection_string (GnumericSheet *gsheet)
gsheet->sel_text_len);
}
/*
* Invoked by Item-Grid to extend the cursor selection
*/
void
gnumeric_sheet_selection_extend (GnumericSheet *gsheet, int col, int row)
{
ItemCursor *ic;
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
g_return_if_fail (gsheet->selecting_cell);
g_return_if_fail (col < SHEET_MAX_COLS);
g_return_if_fail (row < SHEET_MAX_ROWS);
ic = gsheet->selection;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic,
MIN (ic->base_col, col),
MIN (ic->base_row, row),
MAX (ic->base_col, col),
MAX (ic->base_row, row));
selection_insert_selection_string (gsheet);
}
/*
* Invoked by Item-Grid to place the selection cursor on a specific
* spot.
*/
void
gnumeric_sheet_selection_cursor_place (GnumericSheet *gsheet, int col, int row)
{
ItemCursor *ic;
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
g_return_if_fail (gsheet->selecting_cell);
g_return_if_fail (col < SHEET_MAX_COLS);
g_return_if_fail (row < SHEET_MAX_ROWS);
ic = gsheet->selection;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic, col, row, col, row);
selection_insert_selection_string (gsheet);
}
static void
selection_cursor_move_horizontal (GnumericSheet *gsheet, int dir)
{
......@@ -467,19 +535,17 @@ selection_expand_horizontal (GnumericSheet *gsheet, int dir)
}
ic = gsheet->selection;
if (dir == -1){
if (ic->start_col == 0)
if (ic->end_col == SHEET_MAX_COLS-1)
return;
} else {
if (ic->end_col == SHEET_MAX_COLS-1)
return;
}
if (dir == -1 && ic->start_col == ic->end_col)
return;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic,
ic->start_col + (dir == -1 ? dir : 0),
ic->start_col,
ic->start_row,
ic->end_col + (dir == 1 ? dir : 0),
ic->end_col + dir,
ic->end_row);
selection_insert_selection_string (gsheet);
}
......@@ -498,20 +564,18 @@ selection_expand_vertical (GnumericSheet *gsheet, int dir)
ic = gsheet->selection;
if (dir == -1){
if (ic->start_row == 0)
return;
} else {
if (ic->end_row == SHEET_MAX_ROWS-1)
return;
}
if (ic->end_row == SHEET_MAX_ROWS-1)
return;
if (dir == -1 && ic->start_row == ic->end_row)
return;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic,
ic->start_col,
ic->start_row + (dir == -1 ? dir : 0),
ic->start_row,
ic->end_col,
ic->end_row + (dir == 1 ? dir : 0));
ic->end_row + dir);
selection_insert_selection_string (gsheet);
}
......@@ -530,7 +594,7 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_SHIFT_MASK) != 0){
if (cursor_move){
movefn_horizontal = selection_expand_horizontal;
movefn_vertical = selection_expand_vertical;
movefn_vertical = selection_expand_vertical;
} else {
movefn_horizontal = move_horizontal_selection;
movefn_vertical = move_vertical_selection;
......@@ -550,9 +614,9 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
*/
if (cursor_move){
switch (event->keyval){
case GDK_Shift_L: case GDK_Shift_R:
case GDK_Alt_L: case GDK_Alt_R:
case GDK_Control_L: case GDK_Control_R:
case GDK_Shift_L: case GDK_Shift_R:
case GDK_Alt_L: case GDK_Alt_R:
case GDK_Control_L: case GDK_Control_R:
return 1;
}
}
......@@ -694,7 +758,7 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if (event->keyval >= 0x20 && event->keyval <= 0xff)
sheet_start_editing_at_cursor (sheet);
}
stop_cell_selection (gsheet);
gnumeric_sheet_stop_cell_selection (gsheet);
/* Forward the keystroke to the input line */
gtk_widget_event (gsheet->entry, (GdkEvent *) event);
......
......@@ -36,7 +36,8 @@ typedef struct {
SheetModeType mode;
/* This flag keeps track of a cell selector
/*
* This flag keeps track of a cell selector
* (ie, when the user uses the cursor keys
* to select a cell for an expression).
*/
......@@ -44,6 +45,10 @@ typedef struct {
int sel_cursor_pos;
int sel_text_len;
ItemCursor *selection;
/*
* The column and row bars
*/
ItemBar *colbar;
ItemBar *rowbar;
......@@ -58,10 +63,10 @@ void gnumeric_sheet_cursor_set (GnumericSheet *gsheet,
int col, int row);
void gnumeric_sheet_move_cursor (GnumericSheet *gsheet,
int col, int row);
int gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet);
void gnumeric_sheet_set_cursor_bounds (GnumericSheet *gsheet,
int start_col, int start_row,
int end_col, int end_row);
void gnumeric_sheet_stop_editing (GnumericSheet *sheet);
void gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet);
void gnumeric_sheet_make_cell_visible (GnumericSheet *gsheet,
int col, int row);
......@@ -72,6 +77,17 @@ void gnumeric_sheet_stop_cell_selection (GnumericSheet *gsheet);
void gnumeric_sheet_create_editing_cursor (GnumericSheet *gsheet);
void gnumeric_sheet_destroy_editing_cursor (GnumericSheet *gsheet);
/* Managing the selection of cell ranges when editing a formula */
void gnumeric_sheet_start_cell_selection (GnumericSheet *gsheet,
int col, int row);
void gnumeric_sheet_stop_cell_selection (GnumericSheet *gsheet);
void gnumeric_sheet_selection_cursor_place (GnumericSheet *gsheet,
int col, int row);
void gnumeric_sheet_selection_extend (GnumericSheet *gsheet,
int col, int row);
void gnumeric_sheet_stop_editing (GnumericSheet *sheet);
typedef struct {
GnomeCanvasClass parent_class;
} GnumericSheetClass;
......
......@@ -242,7 +242,7 @@ move_vertical_selection (GnumericSheet *gsheet, int count)
* a cell range (if the cursor is in a spot in the expression
* where it makes sense to have a cell reference), false if not.
*/
static int
int
gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet)
{
GtkEntry *entry = GTK_ENTRY (gsheet->entry);
......@@ -267,7 +267,7 @@ gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet)
}
static void
start_cell_selection (GnumericSheet *gsheet)
start_cell_selection_at (GnumericSheet *gsheet, int col, int row)
{
GnomeCanvas *canvas = GNOME_CANVAS (gsheet);
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (canvas->root);
......@@ -282,19 +282,40 @@ start_cell_selection (GnumericSheet *gsheet)
"Sheet", gsheet->sheet_view->sheet,
"Grid", gsheet->item_grid,
"Style", ITEM_CURSOR_ANTED, NULL));
item_cursor_set_bounds (ITEM_CURSOR (gsheet->selection),
sheet->cursor_col,
sheet->cursor_row,
sheet->cursor_col,
sheet->cursor_row);
gsheet->selection->base_col = col;
gsheet->selection->base_row = row;
item_cursor_set_bounds (ITEM_CURSOR (gsheet->selection), col, row, col, row);
gsheet->sel_cursor_pos = GTK_EDITABLE (gsheet->entry)->current_pos;
gsheet->sel_text_len = 0;
}
static void
stop_cell_selection (GnumericSheet *gsheet)
start_cell_selection (GnumericSheet *gsheet)
{
Sheet *sheet = gsheet->sheet_view->sheet;
start_cell_selection_at (gsheet, sheet->cursor_col, sheet->cursor_row);
}
void
gnumeric_sheet_start_cell_selection (GnumericSheet *gsheet, int col, int row)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
if (gsheet->selecting_cell)
return;
start_cell_selection_at (gsheet, col, row);
}
void
gnumeric_sheet_stop_cell_selection (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
if (!gsheet->selecting_cell)
return;
......@@ -342,7 +363,7 @@ gnumeric_sheet_destroy_editing_cursor (GnumericSheet *gsheet)
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
stop_cell_selection (gsheet);
gnumeric_sheet_stop_cell_selection (gsheet);
if (!gsheet->item_editor)
return;
......@@ -396,6 +417,53 @@ selection_insert_selection_string (GnumericSheet *gsheet)
gsheet->sel_text_len);
}
/*
* Invoked by Item-Grid to extend the cursor selection
*/
void
gnumeric_sheet_selection_extend (GnumericSheet *gsheet, int col, int row)
{
ItemCursor *ic;
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
g_return_if_fail (gsheet->selecting_cell);
g_return_if_fail (col < SHEET_MAX_COLS);
g_return_if_fail (row < SHEET_MAX_ROWS);
ic = gsheet->selection;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic,
MIN (ic->base_col, col),
MIN (ic->base_row, row),
MAX (ic->base_col, col),
MAX (ic->base_row, row));
selection_insert_selection_string (gsheet);
}
/*
* Invoked by Item-Grid to place the selection cursor on a specific
* spot.
*/
void
gnumeric_sheet_selection_cursor_place (GnumericSheet *gsheet, int col, int row)
{
ItemCursor *ic;
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
g_return_if_fail (gsheet->selecting_cell);
g_return_if_fail (col < SHEET_MAX_COLS);
g_return_if_fail (row < SHEET_MAX_ROWS);
ic = gsheet->selection;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic, col, row, col, row);
selection_insert_selection_string (gsheet);
}
static void
selection_cursor_move_horizontal (GnumericSheet *gsheet, int dir)
{
......@@ -467,19 +535,17 @@ selection_expand_horizontal (GnumericSheet *gsheet, int dir)
}
ic = gsheet->selection;
if (dir == -1){
if (ic->start_col == 0)
if (ic->end_col == SHEET_MAX_COLS-1)
return;
} else {
if (ic->end_col == SHEET_MAX_COLS-1)
return;
}
if (dir == -1 && ic->start_col == ic->end_col)
return;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic,
ic->start_col + (dir == -1 ? dir : 0),
ic->start_col,
ic->start_row,
ic->end_col + (dir == 1 ? dir : 0),
ic->end_col + dir,
ic->end_row);
selection_insert_selection_string (gsheet);
}
......@@ -498,20 +564,18 @@ selection_expand_vertical (GnumericSheet *gsheet, int dir)
ic = gsheet->selection;
if (dir == -1){
if (ic->start_row == 0)
return;
} else {
if (ic->end_row == SHEET_MAX_ROWS-1)
return;
}
if (ic->end_row == SHEET_MAX_ROWS-1)
return;
if (dir == -1 && ic->start_row == ic->end_row)
return;
selection_remove_selection_string (gsheet);
item_cursor_set_bounds (ic,
ic->start_col,
ic->start_row + (dir == -1 ? dir : 0),
ic->start_row,
ic->end_col,
ic->end_row + (dir == 1 ? dir : 0));
ic->end_row + dir);
selection_insert_selection_string (gsheet);
}
......@@ -530,7 +594,7 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_SHIFT_MASK) != 0){
if (cursor_move){
movefn_horizontal = selection_expand_horizontal;
movefn_vertical = selection_expand_vertical;
movefn_vertical = selection_expand_vertical;
} else {
movefn_horizontal = move_horizontal_selection;
movefn_vertical = move_vertical_selection;
......@@ -550,9 +614,9 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
*/
if (cursor_move){
switch (event->keyval){
case GDK_Shift_L: case GDK_Shift_R:
case GDK_Alt_L: case GDK_Alt_R:
case GDK_Control_L: case GDK_Control_R:
case GDK_Shift_L: case GDK_Shift_R:
case GDK_Alt_L: case GDK_Alt_R:
case GDK_Control_L: case GDK_Control_R:
return 1;
}
}
......@@ -694,7 +758,7 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if (event->keyval >= 0x20 && event->keyval <= 0xff)
sheet_start_editing_at_cursor (sheet);
}
stop_cell_selection (gsheet);
gnumeric_sheet_stop_cell_selection (gsheet);
/* Forward the keystroke to the input line */
gtk_widget_event (gsheet->entry, (GdkEvent *) event);
......
......@@ -36,7 +36,8 @@ typedef struct {
SheetModeType mode;
/* This flag keeps track of a cell selector
/*
* This flag keeps track of a cell selector