Commit a5e04f49 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Fix typo breaking row/col ins/del breakage :-(

Make some minor improvements in status display for row/col selection.

2000-05-14  Jody Goldberg <jgoldberg@home.com>

	* src/commands.h : Reformat.

	* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
	  selection when the topology changes.

	* src/workbook.c (workbook_expr_relocate) : Fix typo.

	* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
	  sheet_update after a change.
parent 6946255f
...@@ -4,6 +4,7 @@ and longer term bugs. ...@@ -4,6 +4,7 @@ and longer term bugs.
Release Critical Release Critical
---------------- ----------------
- Delete sheet does not clear cells from recalc queue.
Long term breakage Long term breakage
------------------ ------------------
......
2000-05-14 Jody Goldberg <jgoldberg@home.com>
* src/commands.h : Reformat.
* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
selection when the topology changes.
* src/workbook.c (workbook_expr_relocate) : Fix typo.
* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
sheet_update after a change.
2000-05-11 Michael Meeks <michael@helixcode.com> 2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus. * src/embeddable-grid.c (grid_view_activate): grab widget focus.
......
2000-05-14 Jody Goldberg <jgoldberg@home.com>
* src/commands.h : Reformat.
* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
selection when the topology changes.
* src/workbook.c (workbook_expr_relocate) : Fix typo.
* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
sheet_update after a change.
2000-05-11 Michael Meeks <michael@helixcode.com> 2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus. * src/embeddable-grid.c (grid_view_activate): grab widget focus.
......
Gnumeric 0.54
Jody:
* Initial applix import.
* Speedup workbook exit, copy/paste.
* Improve row/col insert/del.
Jacob:
* Enable mini icons when available.
--------------------------------------------------------------------------
Gnumeric 0.53 Gnumeric 0.53
Morten: Morten:
......
2000-05-14 Jody Goldberg <jgoldberg@home.com>
* src/commands.h : Reformat.
* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
selection when the topology changes.
* src/workbook.c (workbook_expr_relocate) : Fix typo.
* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
sheet_update after a change.
2000-05-11 Michael Meeks <michael@helixcode.com> 2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus. * src/embeddable-grid.c (grid_view_activate): grab widget focus.
......
2000-05-14 Jody Goldberg <jgoldberg@home.com>
* src/commands.h : Reformat.
* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
selection when the topology changes.
* src/workbook.c (workbook_expr_relocate) : Fix typo.
* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
sheet_update after a change.
2000-05-11 Michael Meeks <michael@helixcode.com> 2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus. * src/embeddable-grid.c (grid_view_activate): grab widget focus.
......
2000-05-14 Jody Goldberg <jgoldberg@home.com>
* src/commands.h : Reformat.
* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
selection when the topology changes.
* src/workbook.c (workbook_expr_relocate) : Fix typo.
* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
sheet_update after a change.
2000-05-11 Michael Meeks <michael@helixcode.com> 2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus. * src/embeddable-grid.c (grid_view_activate): grab widget focus.
......
2000-05-14 Jody Goldberg <jgoldberg@home.com>
* src/commands.h : Reformat.
* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
selection when the topology changes.
* src/workbook.c (workbook_expr_relocate) : Fix typo.
* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
sheet_update after a change.
2000-05-11 Michael Meeks <michael@helixcode.com> 2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus. * src/embeddable-grid.c (grid_view_activate): grab widget focus.
......
2000-05-14 Jody Goldberg <jgoldberg@home.com>
* src/commands.h : Reformat.
* src/commands.c (cmd_ins_del_row_col_{undo,redo}) : unant the
selection when the topology changes.
* src/workbook.c (workbook_expr_relocate) : Fix typo.
* src/sheet-view.c (sheet_view_{col,row}_selection_changed) : Call
sheet_update after a change.
2000-05-11 Michael Meeks <michael@helixcode.com> 2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus. * src/embeddable-grid.c (grid_view_activate): grab widget focus.
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "gnumeric-type-util.h" #include "gnumeric-type-util.h"
#include "gnumeric-util.h" #include "gnumeric-util.h"
#include "commands.h" #include "commands.h"
#include "application.h"
#include "sheet.h" #include "sheet.h"
#include "workbook.h" #include "workbook.h"
#include "workbook-view.h" #include "workbook-view.h"
...@@ -365,7 +366,7 @@ cmd_set_text_destroy (GtkObject *cmd) ...@@ -365,7 +366,7 @@ cmd_set_text_destroy (GtkObject *cmd)
gboolean gboolean
cmd_set_text (CommandContext *context, cmd_set_text (CommandContext *context,
Sheet *sheet, CellPos const * const pos, Sheet *sheet, CellPos const *pos,
char *new_text) char *new_text)
{ {
static int const max_descriptor_width = 15; static int const max_descriptor_width = 15;
...@@ -563,7 +564,7 @@ cmd_area_set_text_destroy (GtkObject *cmd) ...@@ -563,7 +564,7 @@ cmd_area_set_text_destroy (GtkObject *cmd)
gboolean gboolean
cmd_area_set_text (CommandContext *context, EvalPos const *pos, cmd_area_set_text (CommandContext *context, EvalPos const *pos,
char const * const new_text, gboolean const as_array) char const *new_text, gboolean as_array)
{ {
static int const max_descriptor_width = 15; static int const max_descriptor_width = 15;
...@@ -674,6 +675,9 @@ cmd_ins_del_row_col_undo (GnumericCommand *cmd, CommandContext *context) ...@@ -674,6 +675,9 @@ cmd_ins_del_row_col_undo (GnumericCommand *cmd, CommandContext *context)
workbook_recalc (me->sheet->workbook); workbook_recalc (me->sheet->workbook);
sheet_update (me->sheet); sheet_update (me->sheet);
/* Ins/Del Row/Col unants things */
application_clipboard_unant ();
return trouble; return trouble;
} }
...@@ -722,6 +726,9 @@ cmd_ins_del_row_col_redo (GnumericCommand *cmd, CommandContext *context) ...@@ -722,6 +726,9 @@ cmd_ins_del_row_col_redo (GnumericCommand *cmd, CommandContext *context)
workbook_recalc (me->sheet->workbook); workbook_recalc (me->sheet->workbook);
sheet_update (me->sheet); sheet_update (me->sheet);
/* Ins/Del Row/Col unants things */
application_clipboard_unant ();
return trouble; return trouble;
} }
...@@ -934,7 +941,7 @@ cmd_clear_destroy (GtkObject *cmd) ...@@ -934,7 +941,7 @@ cmd_clear_destroy (GtkObject *cmd)
} }
gboolean gboolean
cmd_clear_selection (CommandContext *context, Sheet *sheet, int const clear_flags) cmd_clear_selection (CommandContext *context, Sheet *sheet, int clear_flags)
{ {
GtkObject *obj; GtkObject *obj;
CmdClear *me; CmdClear *me;
...@@ -1327,8 +1334,8 @@ cmd_set_date_time_destroy (GtkObject *cmd) ...@@ -1327,8 +1334,8 @@ cmd_set_date_time_destroy (GtkObject *cmd)
} }
gboolean gboolean
cmd_set_date_time (CommandContext *context, gboolean is_date, cmd_set_date_time (CommandContext *context,
Sheet *sheet, CellPos const * const pos) Sheet *sheet, CellPos const *pos, gboolean is_date)
{ {
GtkObject *obj; GtkObject *obj;
CmdSetDateTime *me; CmdSetDateTime *me;
...@@ -1420,8 +1427,8 @@ cmd_resize_row_col_destroy (GtkObject *cmd) ...@@ -1420,8 +1427,8 @@ cmd_resize_row_col_destroy (GtkObject *cmd)
} }
gboolean gboolean
cmd_resize_row_col (CommandContext *context, gboolean is_col, cmd_resize_row_col (CommandContext *context,
Sheet *sheet, int index) Sheet *sheet, int index, gboolean is_col)
{ {
GtkObject *obj; GtkObject *obj;
CmdResizeRowCol *me; CmdResizeRowCol *me;
...@@ -1627,7 +1634,7 @@ cmd_hide_row_col_destroy (GtkObject *cmd) ...@@ -1627,7 +1634,7 @@ cmd_hide_row_col_destroy (GtkObject *cmd)
gboolean gboolean
cmd_hide_selection_rows_cols (CommandContext *context, Sheet *sheet, cmd_hide_selection_rows_cols (CommandContext *context, Sheet *sheet,
gboolean const is_cols, gboolean const visible) gboolean is_cols, gboolean visible)
{ {
GtkObject *obj; GtkObject *obj;
CmdHideRowCol *me; CmdHideRowCol *me;
...@@ -1746,7 +1753,7 @@ cmd_paste_cut_destroy (GtkObject *cmd) ...@@ -1746,7 +1753,7 @@ cmd_paste_cut_destroy (GtkObject *cmd)
} }
gboolean gboolean
cmd_paste_cut (CommandContext *context, ExprRelocateInfo const * const info) cmd_paste_cut (CommandContext *context, ExprRelocateInfo const *info)
{ {
GtkObject *obj; GtkObject *obj;
CmdPasteCut *me; CmdPasteCut *me;
...@@ -1781,65 +1788,9 @@ cmd_paste_cut (CommandContext *context, ExprRelocateInfo const * const info) ...@@ -1781,65 +1788,9 @@ cmd_paste_cut (CommandContext *context, ExprRelocateInfo const * const info)
return command_push_undo (context, info->target_sheet->workbook, obj); return command_push_undo (context, info->target_sheet->workbook, obj);
} }
/******************************************************************/
#define CMD_COLROW_RESIZE_TYPE (cmd_colrow_resize_get_type ())
#define CMD_COLROW_RESIZE(o) (GTK_CHECK_CAST ((o), CMD_COLROW_RESIZE_TYPE, CmdColRowResize))
typedef struct
{
GnumericCommand parent;
GSList *colrows;
int size_pixels;
} CmdColRowResize;
GNUMERIC_MAKE_COMMAND (CmdColRowResize, cmd_colrow_resize);
static gboolean
cmd_colrow_resize_undo (GnumericCommand *cmd, CommandContext *context)
{
CmdColRowResize *me = CMD_COLROW_RESIZE (cmd);
g_return_val_if_fail (me != NULL, TRUE);
/* FIXME : Fill in */
return FALSE;
}
static gboolean
cmd_colrow_resize_redo (GnumericCommand *cmd, CommandContext *context)
{
CmdColRowResize *me = CMD_COLROW_RESIZE (cmd);
g_return_val_if_fail (me != NULL, TRUE);
/* FIXME : Fill in */
return FALSE;
}
static void
cmd_colrow_resize_destroy (GtkObject *cmd)
{
#if 0
CmdColRowResize *me = CMD_COLROW_RESIZE (cmd);
#endif
/* FIXME : Fill in */
gnumeric_command_destroy (cmd);
}
/* Disable until finished */
static gboolean
cmd_colrow_resize (CommandContext *context,
gboolean is_cols,
GSList *colrows,
int size_pixels)
{
return FALSE;
}
/******************************************************************/ /******************************************************************/
/* /*
* Complete colrow risize * - Complete colrow resize
* *
* TODO : Make a list of commands that should have undo support * TODO : Make a list of commands that should have undo support
* that do not even have stubs * that do not even have stubs
......
...@@ -7,33 +7,37 @@ ...@@ -7,33 +7,37 @@
void command_undo (CommandContext *context, Workbook *wb); void command_undo (CommandContext *context, Workbook *wb);
void command_redo (CommandContext *context, Workbook *wb); void command_redo (CommandContext *context, Workbook *wb);
void command_list_release (GSList *cmds); void command_list_release (GSList *cmds);
gboolean cmd_set_text (CommandContext *context, gboolean cmd_set_text (CommandContext *context, Sheet *sheet,
Sheet *sheet, CellPos const * const pos, CellPos const *pos, char *new_text);
char * new_text);
gboolean cmd_area_set_text (CommandContext *context, EvalPos const *pos,
char const *text, gboolean as_array);
gboolean cmd_set_date_time (CommandContext *context, Sheet *sheet,
CellPos const *pos, gboolean is_date);
gboolean cmd_set_date_time (CommandContext *context, gboolean is_date, gboolean cmd_insert_cols (CommandContext *context, Sheet *sheet,
Sheet *sheet, CellPos const * const pos); int start_col, int count);
gboolean cmd_insert_rows (CommandContext *context, Sheet *sheet,
int start_row, int count);
gboolean cmd_delete_cols (CommandContext *context, Sheet *sheet,
int start_col, int count);
gboolean cmd_delete_rows (CommandContext *context, Sheet *sheet,
int start_row, int count);
gboolean cmd_insert_cols (CommandContext *context, gboolean cmd_resize_row_col (CommandContext *context, Sheet *sheet,
Sheet *sheet, int start_col, int count); int index, gboolean is_col);
gboolean cmd_insert_rows (CommandContext *context,
Sheet *sheet, int start_row, int count);
gboolean cmd_delete_cols (CommandContext *context,
Sheet *sheet, int start_col, int count);
gboolean cmd_delete_rows (CommandContext *context,
Sheet *sheet, int start_row, int count);
gboolean cmd_resize_row_col (CommandContext *context, gboolean is_col, gboolean cmd_hide_selection_rows_cols (CommandContext *context, Sheet *sheet,
Sheet *sheet, int index); gboolean is_cols, gboolean visible);
gboolean cmd_paste_cut (CommandContext *context, gboolean cmd_paste_cut (CommandContext *context,
ExprRelocateInfo const * const info); ExprRelocateInfo const *info);
gboolean cmd_rename_sheet (CommandContext *context, Workbook *wb, gboolean cmd_rename_sheet (CommandContext *context, Workbook *wb,
const char *old_name, const char *new_name); char const *old_name, char const *new_name);
gboolean cmd_sort (CommandContext *context, Sheet *sheet, gboolean cmd_sort (CommandContext *context, Sheet *sheet,
Range *range, SortClause *clauses, Range *range, SortClause *clauses,
...@@ -42,14 +46,7 @@ gboolean cmd_sort (CommandContext *context, Sheet *sheet, ...@@ -42,14 +46,7 @@ gboolean cmd_sort (CommandContext *context, Sheet *sheet,
gboolean cmd_format (CommandContext *context, Sheet *sheet, gboolean cmd_format (CommandContext *context, Sheet *sheet,
MStyle *style, MStyleBorder **borders); MStyle *style, MStyleBorder **borders);
gboolean cmd_clear_selection (CommandContext *context, Sheet *sheet, int const clear_flags); gboolean cmd_clear_selection (CommandContext *context, Sheet *sheet,
int const clear_flags);
gboolean cmd_hide_selection_rows_cols (CommandContext *context, Sheet *sheet,
gboolean const is_cols, gboolean const visible);
gboolean cmd_area_set_text (CommandContext *context, EvalPos const *pos,
char const * const text, gboolean const as_array);
#endif /* GNUMERIC_COMMAND_H */ #endif /* GNUMERIC_COMMAND_H */
...@@ -339,6 +339,9 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She ...@@ -339,6 +339,9 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She
sheet_selection_extend_to (sheet, col, SHEET_MAX_ROWS - 1); sheet_selection_extend_to (sheet, col, SHEET_MAX_ROWS - 1);
gnumeric_sheet_make_cell_visible (gsheet, col, gsheet->row.first, FALSE); gnumeric_sheet_make_cell_visible (gsheet, col, gsheet->row.first, FALSE);
} }
/* The edit pos, and the selection may have changed */
sheet_update (sheet);
} }
struct closure_colrow_resize { struct closure_colrow_resize {
...@@ -423,6 +426,8 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She ...@@ -423,6 +426,8 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She
sheet_selection_extend_to (sheet, SHEET_MAX_COLS-1, row); sheet_selection_extend_to (sheet, SHEET_MAX_COLS-1, row);
gnumeric_sheet_make_cell_visible (gsheet, gsheet->col.first, row, FALSE); gnumeric_sheet_make_cell_visible (gsheet, gsheet->col.first, row, FALSE);
} }
/* The edit pos, and the selection may have changed */
sheet_update (sheet);
} }
static void static void
......
...@@ -339,6 +339,9 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She ...@@ -339,6 +339,9 @@ sheet_view_col_selection_changed (ItemBar *item_bar, int col, int modifiers, She
sheet_selection_extend_to (sheet, col, SHEET_MAX_ROWS - 1); sheet_selection_extend_to (sheet, col, SHEET_MAX_ROWS - 1);
gnumeric_sheet_make_cell_visible (gsheet, col, gsheet->row.first, FALSE); gnumeric_sheet_make_cell_visible (gsheet, col, gsheet->row.first, FALSE);
} }
/* The edit pos, and the selection may have changed */
sheet_update (sheet);
} }
struct closure_colrow_resize { struct closure_colrow_resize {
...@@ -423,6 +426,8 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She ...@@ -423,6 +426,8 @@ sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, She
sheet_selection_extend_to (sheet, SHEET_MAX_COLS-1, row); sheet_selection_extend_to (sheet, SHEET_MAX_COLS-1, row);
gnumeric_sheet_make_cell_visible (gsheet, gsheet->col.first, row, FALSE); gnumeric_sheet_make_cell_visible (gsheet, gsheet->col.first, row, FALSE);
} }
/* The edit pos, and the selection may have changed */
sheet_update (sheet);
} }
static void static void
......
...@@ -914,16 +914,16 @@ static void ...@@ -914,16 +914,16 @@ static void
insert_current_date_cmd (GtkWidget *widget, Workbook *wb) insert_current_date_cmd (GtkWidget *widget, Workbook *wb)
{ {
Sheet *sheet = wb->current_sheet; Sheet *sheet = wb->current_sheet;
cmd_set_date_time (workbook_command_context_gui (wb), TRUE, cmd_set_date_time (workbook_command_context_gui (wb),
sheet, &sheet->cursor.edit_pos); sheet, &sheet->cursor.edit_pos, TRUE);
} }
static void static void
insert_current_time_cmd (GtkWidget *widget, Workbook *wb) insert_current_time_cmd (GtkWidget *widget, Workbook *wb)
{ {
Sheet *sheet = wb->current_sheet; Sheet *sheet = wb->current_sheet;
cmd_set_date_time (workbook_command_context_gui (wb), FALSE, cmd_set_date_time (workbook_command_context_gui (wb),
sheet, &sheet->cursor.edit_pos); sheet, &sheet->cursor.edit_pos, FALSE);
} }
static void static void
...@@ -3370,7 +3370,6 @@ workbook_expr_relocate (Workbook *wb, ExprRelocateInfo const *info) ...@@ -3370,7 +3370,6 @@ workbook_expr_relocate (Workbook *wb, ExprRelocateInfo const *info)
for (l = cells; l; l = l->next) { for (l = cells; l; l = l->next) {
Cell *cell = l->data; Cell *cell = l->data;
EvalPos pos;
ExprRewriteInfo rwinfo; ExprRewriteInfo rwinfo;
ExprTree *newtree; ExprTree *newtree;
...@@ -3382,11 +3381,13 @@ workbook_expr_relocate (Workbook *wb, ExprRelocateInfo const *info) ...@@ -3382,11 +3381,13 @@ workbook_expr_relocate (Workbook *wb, ExprRelocateInfo const *info)
if (newtree) { if (newtree) {
/* Don't store relocations if they were inside the region /* Don't store relocations if they were inside the region
* being moved. That is handled elsewhere */ * being moved. That is handled elsewhere */
if (info->origin_sheet != pos.sheet || if (info->origin_sheet != rwinfo.u.relocate.pos.sheet ||
!range_contains (&info->origin, pos.eval.col, pos.eval.row)) { !range_contains (&info->origin,
rwinfo.u.relocate.pos.eval.col,
rwinfo.u.relocate.pos.eval.row)) {
struct expr_relocate_storage *tmp = struct expr_relocate_storage *tmp =
g_new (struct expr_relocate_storage, 1); g_new (struct expr_relocate_storage, 1);
tmp->pos = pos; tmp->pos = rwinfo.u.relocate.pos;
tmp->oldtree = cell->u.expression; tmp->oldtree = cell->u.expression;
expr_tree_ref (tmp->oldtree); expr_tree_ref (tmp->oldtree);
undo_info = g_slist_prepend (undo_info, tmp); undo_info = g_slist_prepend (undo_info, tmp);
......
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