Commit 5784bf05 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Fix a few bugs. Flag a few bugs. Start on the exception handling

* Fix a few bugs.
* Flag a few bugs.
* Start on the exception handling mechanism.
* Move many typedefs into gnumeric.h to start the process
  of decoupling the headers.

1999-12-17  Jody Goldberg <jgoldberg@home.com>

	* src/cell.c (cell_cleanout) : Publicize.

	* src/sheet.c (clear_cell_content) : Delete.
	(sheet_clear_region_content) : Use sheet_clear_region but leave the
	  styles in place.

1999-12-15  Jody Goldberg <jgoldberg@home.com>

	* src/gnumeric.h : Move many of the typedefs here.

	* src/dialogs/dialog-cell-sort.c (dialog_cell_sort) : Tweak some
	  const issues and minor logic problems at the boundaries.

1999-12-14  Jody Goldberg <jgoldberg@home.com>

	* src/workbook-view.c (command_context_gui) : New function.

	* src/main.c (gnumeric_main) : Add a 'quit' flag for use in testing.
	  It causes the app to exit immediately after loading all the selected
	  books.

	* src/file.c (workbook_import) : Bug 3977.

	* src/corba-sheet.c (command_context_corba) : New function
	  temporarily located here.
	(Sheet_selection_copy) : Pass a CommandContext.
	(Sheet_selection_cut) : Ditto
	(Sheet_selection_paste) : Ditto
	(Sheet_clear_region) : Ditto
	(Sheet_clear_region_content) : Ditto
	(Sheet_insert_col) : Ditto
	(Sheet_delete_col) : Ditto
	(Sheet_insert_row) : Ditto
	(Sheet_delete_row) : Ditto
	(Sheet_shift_rows) : Ditto
	(Sheet_shift_cols) : Ditto

	* src/item-cursor.c (item_cursor_do_action) : Ditto.

	* src/item-grid.c (context_cut_cmd) : Ditto.
	(context_cut_cmd) : Ditto.
	(context_copy_cmd) : Ditto.
	(context_paste_cmd) : Ditto.
	(context_paste_special_cmd) : Ditto.
	(context_clear_cmd) : Ditto.

	* src/clipboard.[ch] (do_clipboard_paste_cell_region) : Take a
	  CommandContext.
	(sheet_paste_selection) : Ditto.
	(clipboard_paste_region) : Ditto.

	* src/selection.c (segments_intersect) : Return additional state 5
	  to designate equality.
	(selection_apply) : Use the equality state to simplify state selection.
	(selection_is_simple) : Use a command context.
	(sheet_selection_copy) : Ditto.
	(sheet_selection_cut) : Ditto.
	(sheet_selection_paste) : Ditto.
	(sheet_selection_clear) : Ditto.
	(sheet_selection_clear_content) : Ditto.
	(sheet_selection_clear_comments) : Ditto.
	(sheet_selection_clear_formats) : Ditto.

	* src/workbook.c (copy_cmd) : Ditto.
	(cut_cmd) : Ditto.
	(paste_cmd) : Ditto.
	(paste_special_cmd) : Ditto.
	(insert_cols_cmd) : Ditto.
	(insert_rows_cmd) : Ditto.
	(clear_all_cmd) : Ditto.
	(clear_formats_cmd) : Ditto.
	(clear_comments_cmd) : Ditto.
	(clear_content_cmd) : Ditto.

	* src/dialogs/dialog-delete-cells.c (dialog_delete_cells_impl) :
	  Ditto.
	(dialog_delete_cells) : Ditto.

	* src/dialogs/dialog-insert-cells.c (dialog_insert_cells_impl) :
	  Ditto.
	(dialog_insert_cells) : Ditto.
parent cd117bfb
1999-12-17 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_cleanout) : Publicize.
* src/sheet.c (clear_cell_content) : Delete.
(sheet_clear_region_content) : Use sheet_clear_region but leave the
styles in place.
1999-12-17 Morten Welinder <terra@diku.dk>
* src/functions/fn-stat.c: White-space mania.
......@@ -33,7 +41,7 @@
1999-12-14 Joe Sakosky <josak@ibm.net>
* src/file.c: privatized FileOpener FileSaver.
* src/file.c: privatized fileopener filesaver.
* src/file.h: ditto
......@@ -42,6 +50,82 @@
* src/workbook.c (workbook_bonobo_setup): kill goadid.
(workbook_new): kill brainless bug.
1999-12-15 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric.h : Move many of the typedefs here.
* src/dialogs/dialog-cell-sort.c (dialog_cell_sort) : Tweak some
const issues and minor logic problems at the boundaries.
1999-12-14 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (command_context_gui) : New function.
* src/main.c (gnumeric_main) : Add a 'quit' flag for use in testing.
It causes the app to exit immediately after loading all the selected
books.
* src/file.c (workbook_import) : Bug 3977.
* src/corba-sheet.c (command_context_corba) : New function
temporarily located here.
(Sheet_selection_copy) : Pass a CommandContext.
(Sheet_selection_cut) : Ditto
(Sheet_selection_paste) : Ditto
(Sheet_clear_region) : Ditto
(Sheet_clear_region_content) : Ditto
(Sheet_insert_col) : Ditto
(Sheet_delete_col) : Ditto
(Sheet_insert_row) : Ditto
(Sheet_delete_row) : Ditto
(Sheet_shift_rows) : Ditto
(Sheet_shift_cols) : Ditto
* src/item-cursor.c (item_cursor_do_action) : Ditto.
* src/item-grid.c (context_cut_cmd) : Ditto.
(context_cut_cmd) : Ditto.
(context_copy_cmd) : Ditto.
(context_paste_cmd) : Ditto.
(context_paste_special_cmd) : Ditto.
(context_clear_cmd) : Ditto.
* src/clipboard.[ch] (do_clipboard_paste_cell_region) : Take a
CommandContext.
(sheet_paste_selection) : Ditto.
(clipboard_paste_region) : Ditto.
* src/selection.c (segments_intersect) : Return additional state 5
to designate equality.
(selection_apply) : Use the equality state to simplify state selection.
(selection_is_simple) : Use a command context.
(sheet_selection_copy) : Ditto.
(sheet_selection_cut) : Ditto.
(sheet_selection_paste) : Ditto.
(sheet_selection_clear) : Ditto.
(sheet_selection_clear_content) : Ditto.
(sheet_selection_clear_comments) : Ditto.
(sheet_selection_clear_formats) : Ditto.
* src/workbook.c (copy_cmd) : Ditto.
(cut_cmd) : Ditto.
(paste_cmd) : Ditto.
(paste_special_cmd) : Ditto.
(insert_cols_cmd) : Ditto.
(insert_rows_cmd) : Ditto.
(clear_all_cmd) : Ditto.
(clear_formats_cmd) : Ditto.
(clear_comments_cmd) : Ditto.
(clear_content_cmd) : Ditto.
* src/dialogs/dialog-delete-cells.c (dialog_delete_cells_impl) :
Ditto.
(dialog_delete_cells) : Ditto.
* src/dialogs/dialog-insert-cells.c (dialog_insert_cells_impl) :
Ditto.
(dialog_insert_cells) : Ditto.
1999-12-13 Michael Meeks <mmeeks@gnu.org>
* src/sheet-style.c (sheet_style_optimize): add check for
......
......@@ -15,6 +15,10 @@ JP:
Frank:
* Worked on Excel summary export
Jody:
* Begin exception handling for corba vs gui.
* Bug fixing.
Cort:
* Expanded CORBA API.
......
1999-12-17 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_cleanout) : Publicize.
* src/sheet.c (clear_cell_content) : Delete.
(sheet_clear_region_content) : Use sheet_clear_region but leave the
styles in place.
1999-12-17 Morten Welinder <terra@diku.dk>
* src/functions/fn-stat.c: White-space mania.
......@@ -33,7 +41,7 @@
1999-12-14 Joe Sakosky <josak@ibm.net>
* src/file.c: privatized FileOpener FileSaver.
* src/file.c: privatized fileopener filesaver.
* src/file.h: ditto
......@@ -42,6 +50,82 @@
* src/workbook.c (workbook_bonobo_setup): kill goadid.
(workbook_new): kill brainless bug.
1999-12-15 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric.h : Move many of the typedefs here.
* src/dialogs/dialog-cell-sort.c (dialog_cell_sort) : Tweak some
const issues and minor logic problems at the boundaries.
1999-12-14 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c (command_context_gui) : New function.
* src/main.c (gnumeric_main) : Add a 'quit' flag for use in testing.
It causes the app to exit immediately after loading all the selected
books.
* src/file.c (workbook_import) : Bug 3977.
* src/corba-sheet.c (command_context_corba) : New function
temporarily located here.
(Sheet_selection_copy) : Pass a CommandContext.
(Sheet_selection_cut) : Ditto
(Sheet_selection_paste) : Ditto
(Sheet_clear_region) : Ditto
(Sheet_clear_region_content) : Ditto
(Sheet_insert_col) : Ditto
(Sheet_delete_col) : Ditto
(Sheet_insert_row) : Ditto
(Sheet_delete_row) : Ditto
(Sheet_shift_rows) : Ditto
(Sheet_shift_cols) : Ditto
* src/item-cursor.c (item_cursor_do_action) : Ditto.
* src/item-grid.c (context_cut_cmd) : Ditto.
(context_cut_cmd) : Ditto.
(context_copy_cmd) : Ditto.
(context_paste_cmd) : Ditto.
(context_paste_special_cmd) : Ditto.
(context_clear_cmd) : Ditto.
* src/clipboard.[ch] (do_clipboard_paste_cell_region) : Take a
CommandContext.
(sheet_paste_selection) : Ditto.
(clipboard_paste_region) : Ditto.
* src/selection.c (segments_intersect) : Return additional state 5
to designate equality.
(selection_apply) : Use the equality state to simplify state selection.
(selection_is_simple) : Use a command context.
(sheet_selection_copy) : Ditto.
(sheet_selection_cut) : Ditto.
(sheet_selection_paste) : Ditto.
(sheet_selection_clear) : Ditto.
(sheet_selection_clear_content) : Ditto.
(sheet_selection_clear_comments) : Ditto.
(sheet_selection_clear_formats) : Ditto.
* src/workbook.c (copy_cmd) : Ditto.
(cut_cmd) : Ditto.
(paste_cmd) : Ditto.
(paste_special_cmd) : Ditto.
(insert_cols_cmd) : Ditto.
(insert_rows_cmd) : Ditto.
(clear_all_cmd) : Ditto.
(clear_formats_cmd) : Ditto.
(clear_comments_cmd) : Ditto.
(clear_content_cmd) : Ditto.
* src/dialogs/dialog-delete-cells.c (dialog_delete_cells_impl) :
Ditto.
(dialog_delete_cells) : Ditto.
* src/dialogs/dialog-insert-cells.c (dialog_insert_cells_impl) :
Ditto.
(dialog_insert_cells) : Ditto.
1999-12-13 Michael Meeks <mmeeks@gnu.org>
* src/sheet-style.c (sheet_style_optimize): add check for
......
......@@ -45,7 +45,7 @@ cell_modified (Cell *cell)
/* Empty a cell's value, entered_text, and parsed_node. */
static void
void
cell_cleanout (Cell *cell)
{
if (cell->parsed_node){
......
......@@ -2,13 +2,7 @@
#define GNUMERIC_CELL_H
#include <glib.h>
/* Forward references for structures. */
typedef struct _Cell Cell;
typedef struct _CellRegion CellRegion;
typedef GList CellList;
typedef struct _ColRowInfo ColRowInfo;
#include "gnumeric.h"
#include "style.h"
#include "sheet.h"
#include "sheet-view.h"
......@@ -33,12 +27,12 @@ struct _ColRowInfo {
void *spans; /* Only used for rows */
};
typedef struct
struct _ColRowCollection
{
int max_used;
ColRowInfo default_style;
GPtrArray * info;
} ColRowCollection;
};
#define COL_INTERNAL_WIDTH(col) ((col)->pixels - ((col)->margin_b + (col)->margin_a))
#define ROW_INTERNAL_HEIGHT(row) ((row)->pixels - ((row)->margin_b + (row)->margin_a))
......@@ -138,11 +132,14 @@ void cell_set_array_formula (Sheet *sheet, int rowa, int cola,
void cell_set_format (Cell *cell, const char *format);
void cell_set_format_simple (Cell *cell, const char *format);
void cell_set_format_from_style (Cell *cell, StyleFormat *style_format);
void cell_set_comment (Cell *cell, const char *str);
void cell_comment_destroy (Cell *cell);
void cell_comment_reposition (Cell *cell);
char *cell_get_comment (Cell *cell);
void cell_cleanout (Cell *cell);
void cell_set_rendered_text (Cell *cell, const char *rendered_text);
MStyle *cell_get_mstyle (const Cell *cell);
void cell_set_mstyle (const Cell *cell, MStyle *mstyle);
......
......@@ -15,6 +15,7 @@
#include "selection.h"
#include "application.h"
#include "render-ascii.h"
#include "workbook-view.h"
/*
* Callback information.
......@@ -131,7 +132,8 @@ paste_cell_flags (Sheet *dest_sheet, int target_col, int target_row,
* paste_flags: controls what gets pasted (see clipboard.h for details
*/
static void
do_clipboard_paste_cell_region (CellRegion *region, Sheet *dest_sheet,
do_clipboard_paste_cell_region (CmdContext *context,
CellRegion *region, Sheet *dest_sheet,
int dest_col, int dest_row,
int paste_width, int paste_height,
int paste_flags)
......@@ -143,11 +145,11 @@ do_clipboard_paste_cell_region (CellRegion *region, Sheet *dest_sheet,
/* clear the region where we will paste */
if (paste_flags & (PASTE_VALUES | PASTE_FORMULAS))
sheet_clear_region (dest_sheet,
sheet_clear_region (context, dest_sheet,
dest_col, dest_row,
dest_col + paste_width - 1,
dest_row + paste_height - 1,
NULL);
TRUE);
/* If no operations are defined, we clear the area */
if (!(paste_flags & PASTE_OPER_MASK))
......@@ -290,7 +292,8 @@ x_selection_to_cell_region (char *data, int len)
*
*/
static void
sheet_paste_selection (Sheet *sheet, CellRegion *content, SheetSelection *ss, clipboard_paste_closure_t *pc)
sheet_paste_selection (CmdContext *context, Sheet *sheet,
CellRegion *content, SheetSelection *ss, clipboard_paste_closure_t *pc)
{
int paste_height, paste_width;
int end_col, end_row;
......@@ -327,7 +330,7 @@ sheet_paste_selection (Sheet *sheet, CellRegion *content, SheetSelection *ss, cl
}
/* Do the actual paste operation */
do_clipboard_paste_cell_region (
do_clipboard_paste_cell_region (context,
content, sheet,
pc->dest_col, pc->dest_row,
paste_width, paste_height,
......@@ -377,7 +380,8 @@ x_selection_received (GtkWidget *widget, GtkSelectionData *sel, guint time, gpoi
} else
content = x_selection_to_cell_region (sel->data, sel->length);
sheet_paste_selection (pc->dest_sheet, content, ss, pc);
sheet_paste_selection (command_context_gui(),
pc->dest_sheet, content, ss, pc);
/* Release the resources we used */
if (sel->length >= 0)
......@@ -576,7 +580,8 @@ find_local_workbook_with_selection (void)
* Main entry point for the paste code
*/
void
clipboard_paste_region (CellRegion *region, Sheet *dest_sheet,
clipboard_paste_region (CmdContext *context,
CellRegion *region, Sheet *dest_sheet,
int dest_col, int dest_row,
int paste_flags, guint32 time)
{
......@@ -621,7 +626,8 @@ clipboard_paste_region (CellRegion *region, Sheet *dest_sheet,
content = region;
sheet_paste_selection (dest_sheet, content, dest_sheet->selections->data, data);
sheet_paste_selection (context, dest_sheet,
content, dest_sheet->selections->data, data);
/* Check that this has not already been freed */
if (workbook_holding_selection->clipboard_paste_callback_data != NULL) {
......
......@@ -24,7 +24,7 @@ CellRegion *clipboard_copy_cell_range (Sheet *sheet,
int start_col, int start_row,
int end_col, int end_row);
void clipboard_paste_region (CellRegion *region,
void clipboard_paste_region (CmdContext *context, CellRegion *region,
Sheet *dest_sheet,
int dest_col,
int dest_row,
......
......@@ -48,6 +48,13 @@ out_of_range (CORBA_Environment *ev)
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Gnumeric_Sheet_OutOfRange, NULL);
}
struct _CmdContext *
command_context_corba ()
{
/* FIXME FIXME FIXME : corba context */
return NULL;
}
/*
* Parses a list of ranges, returns a GList containing pointers to
* Value structures. Sets the return_list pointer to point to a
......@@ -177,7 +184,7 @@ Sheet_selection_copy (PortableServer_Servant servant, CORBA_Environment *ev)
{
Sheet *sheet = sheet_from_servant (servant);
sheet_selection_copy (sheet);
sheet_selection_copy (command_context_corba (), sheet);
}
static void
......@@ -185,7 +192,7 @@ Sheet_selection_cut (PortableServer_Servant servant, CORBA_Environment *ev)
{
Sheet *sheet = sheet_from_servant (servant);
sheet_selection_cut (sheet);
sheet_selection_cut (command_context_corba (), sheet);
}
static void
......@@ -198,7 +205,8 @@ Sheet_selection_paste (PortableServer_Servant servant,
verify_col (dest_col);
verify_row (dest_row);
sheet_selection_paste (sheet, dest_col, dest_row, paste_flags, 0);
sheet_selection_paste (command_context_corba (), sheet,
dest_col, dest_row, paste_flags, 0);
}
static void
......@@ -211,7 +219,8 @@ Sheet_clear_region (PortableServer_Servant servant,
verify_region (start_col, start_row, end_col, end_row);
sheet_clear_region (sheet, start_col, start_row, end_col, end_row, NULL);
sheet_clear_region (command_context_corba (), sheet, start_col, start_row,
end_col, end_row, TRUE);
}
static void
......@@ -223,7 +232,8 @@ Sheet_clear_region_content (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_region (start_col, start_row, end_col, end_row);
sheet_clear_region_content (sheet, start_col, start_row, end_col, end_row, NULL);
sheet_clear_region_content (command_context_corba (), sheet,
start_col, start_row, end_col, end_row);
}
static void
......@@ -795,7 +805,8 @@ Sheet_insert_col (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_col (col);
sheet_insert_col (sheet, col, count);
sheet_insert_cols (command_context_corba (), sheet,
col, count);
}
static void
......@@ -806,7 +817,8 @@ Sheet_delete_col (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_col (col);
sheet_delete_col (sheet, col, count);
sheet_delete_cols (command_context_corba (), sheet,
col, count);
}
static void
......@@ -817,7 +829,8 @@ Sheet_insert_row (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_row (row);
sheet_insert_row (sheet, row, count);
sheet_insert_rows (command_context_corba (), sheet,
row, count);
}
static void
......@@ -828,7 +841,8 @@ Sheet_delete_row (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_row (row);
sheet_delete_row (sheet, row, count);
sheet_delete_rows (command_context_corba (), sheet,
row, count);
}
static void
......@@ -843,7 +857,8 @@ Sheet_shift_rows (PortableServer_Servant servant,
verify_row (end_row);
verify_col (col);
sheet_shift_rows (sheet, col, start_row, end_row, count);
sheet_shift_rows (command_context_corba (), sheet,
col, start_row, end_row, count);
}
static void
......@@ -858,7 +873,8 @@ Sheet_shift_cols (PortableServer_Servant servant,
verify_row (start_row);
verify_row (end_row);
sheet_shift_cols (sheet, col, start_row, end_row, count);
sheet_shift_cols (command_context_corba (), sheet,
col, start_row, end_row, count);
}
static GNOME_Gnumeric_Sheet_ValueVector *
......@@ -900,7 +916,7 @@ Sheet_range_get_values (PortableServer_Servant servant, const CORBA_char *range,
vector->_maximum = 0;
return vector;
}
}
/*
* Fill in the vector
......
......@@ -4,4 +4,6 @@
extern PortableServer_POA gnumeric_poa;
gboolean WorkbookFactory_init (void);
struct _CmdContext * command_context_corba ();
#endif
......@@ -583,8 +583,8 @@ dialog_cell_sort (Workbook * inwb, Sheet * sheet)
GtkWidget *table, *check, *rb1, *rb2;
int btn, lp, i;
int start_col, start_row, end_col, end_row;
Range *sel;
Range range;
Range const *sel;
Range target;
SortFlow sort_flow;
g_return_if_fail(inwb);
......@@ -598,18 +598,18 @@ dialog_cell_sort (Workbook * inwb, Sheet * sheet)
return;
}
if (sel->end.row >= SHEET_MAX_ROWS - 2 ||
sel->end.col >= SHEET_MAX_COLS - 2) {
range = sheet_get_extent (sheet);
if (sel->end.col >= SHEET_MAX_COLS - 2) {
sel->start.col = range.start.col;
sel->end.col = range.end.col;
target = *sel;
if (target.end.row >= SHEET_MAX_ROWS - 2 ||
target.end.col >= SHEET_MAX_COLS - 2) {
Range range = sheet_get_extent (sheet);
if (target.end.col >= SHEET_MAX_COLS - 2) {
target.start.col = range.start.col;
target.end.col = range.end.col;
}
if (sel->end.row >= SHEET_MAX_ROWS - 2) {
sel->start.row = range.start.row;
sel->end.row = range.end.row;
if (target.end.row >= SHEET_MAX_ROWS - 2) {
target.start.row = range.start.row;
target.end.row = range.end.row;
}
sel = &range;
}
start_row = sel->start.row;
......
......@@ -12,6 +12,7 @@
#include "gnumeric-util.h"
#include "selection.h"
#include "dialogs.h"
#include "workbook-view.h"
#define GLADE_FILE "delete-cells.glade"
......@@ -47,17 +48,21 @@ dialog_delete_cells_impl (Workbook *wb, Sheet *sheet, GladeXML *gui)
rows = ss->user.end.row - ss->user.start.row + 1;
if (i == 0)
sheet_shift_rows (sheet, ss->user.start.col + cols,
sheet_shift_rows (command_context_gui(), sheet,
ss->user.start.col + cols,
ss->user.start.row,
ss->user.end.row, -cols);
else if (i == 1)
sheet_shift_cols (sheet, ss->user.start.col,
sheet_shift_cols (command_context_gui(), sheet,
ss->user.start.col,
ss->user.end.col,
ss->user.start.row + rows, -rows);
else if (i == 2)
sheet_delete_row (sheet, ss->user.start.row, rows);
sheet_delete_rows (command_context_gui(), sheet,
ss->user.start.row, rows);
else if (i == 3)
sheet_delete_col (sheet, ss->user.start.col, cols);
sheet_delete_cols (command_context_gui(), sheet,
ss->user.start.col, cols);
}
/* If user closed the dialog with prejudice, it's already destroyed */
......@@ -76,7 +81,7 @@ dialog_delete_cells (Workbook *wb, Sheet *sheet)
g_return_if_fail (sheet != NULL);
g_return_if_fail (IS_SHEET (sheet));
if (!selection_is_simple (sheet, _("delete cells")))
if (!selection_is_simple (command_context_gui(), sheet, _("delete cells")))
return;
ss = sheet->selections->data;
......@@ -84,14 +89,14 @@ dialog_delete_cells (Workbook *wb, Sheet *sheet)
rows = ss->user.end.row - ss->user.start.row + 1;
/* short circuit the dialog if an entire row/column is selected */
if (ss->user.start.row == 0 && ss->user.end.row >= SHEET_MAX_ROWS-1)
{
sheet_delete_col (sheet, ss->user.start.col, cols);
if (ss->user.start.row == 0 && ss->user.end.row >= SHEET_MAX_ROWS-1) {
sheet_delete_cols (command_context_gui(), sheet,
ss->user.start.col, cols);
return;
}
if (ss->user.start.col == 0 && ss->user.end.col >= SHEET_MAX_COLS-1)
{
sheet_delete_row (sheet, ss->user.start.row, rows);
if (ss->user.start.col == 0 && ss->user.end.col >= SHEET_MAX_COLS-1) {
sheet_delete_rows (command_context_gui(), sheet,
ss->user.start.row, rows);
return;
}
......
......@@ -12,6 +12,7 @@
#include "gnumeric-util.h"
#include "selection.h"
#include "dialogs.h"
#include "workbook-view.h"
#define GLADE_FILE "insert-cells.glade"
......@@ -47,17 +48,21 @@ dialog_insert_cells_impl (Workbook *wb, Sheet *sheet, GladeXML *gui)
rows = ss->user.end.row - ss->user.start.row + 1;
if (i == 0)
sheet_shift_rows (sheet, ss->user.start.col,
sheet_shift_rows (command_context_gui(), sheet,
ss->user.start.col,
ss->user.start.row,
ss->user.end.row, cols);
else if (i == 1)
sheet_shift_cols (sheet, ss->user.start.col,
sheet_shift_cols (command_context_gui(), sheet,
ss->user.start.col,
ss->user.end.col,
ss->user.start.row, rows);
else if (i == 2)
sheet_insert_row (sheet, ss->user.start.row, rows);
sheet_insert_rows (command_context_gui(), sheet,
ss->user.start.row, rows);
else if (i == 3)
sheet_insert_col (sheet, ss->user.start.col, cols);
sheet_insert_cols (command_context_gui(), sheet,
ss->user.start.col, cols);
}