Commit d99c96e7 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg
Browse files

- Some xml fixes - Row/col ins/del undo fix. - Mouse scroll fix, and

- Some xml fixes
- Row/col ins/del undo fix.
- Mouse scroll fix, and scrollbar speedup.

2000-01-27  Jody Goldberg <jgoldberg@home.com>

	* *.c : convert to using Workbook::current_sheet rather than
	    workbook_get_current_sheet.

	* src/workbook.c : Add a current_sheet member to Workbook.
	Delete some old test code.
	(do_focus_sheet) : Cancel inputs and update edit area with new cell.
	(workbook_focus_current_sheet) : Update current_sheet.
	(workbook_get_current_sheet) : Delete.

	* src/sheet.c (sheet_cursor_{move, set}) : Delete call to
	  gnumeric_sheet_cursor_set.

	* src/sheet.c (sheet_{row,col}_add) : Use sheet_view_scrollbar_config.
	  We should not be touching GUI directly.

	* src/sheet-view.c (sheet_view_scrollbar_config) : Set the scrollbar's
	  value as well as it max and page info.

	* src/gnumeric-sheet.[ch] (gnumeric_sheet_cursor_set) : Delete.
	  The scrollbars reflect the visible range, not the cursor cell.

	* src/item-cursor.c (item_cursor_set_bounds_visibly) : Remove call to
	  gnumeric_sheet_cursor_set.

2000-01-26  Jody Goldberg <jgoldberg@home.com>

	* src/xml-io.c (xml_workbook_write) : Do not save the current
	  edit-text.  We don't save the current cell or the current selection
	  so restoring the text of the ex-cursor is quite confusing.
	(xml_workbook_read) : Restore window size.
	(gnumeric_xml_sheet_{read,write}) : Delete unused.
	(xml_get_range) : Utility routine.
	(xml_read_selection_info) : Utility routine to restore the selection.

	* src/sheet.c (sheet_{insert,delete}_{cols,rows}) : Do the
	  insert/delete even if it looks like there are no cells there.
	  There may be styles.
parent a0ec6d64
2000-01-27 Jody Goldberg <jgoldberg@home.com>
* *.c : convert to using Workbook::current_sheet rather than
workbook_get_current_sheet.
* src/workbook.c : Add a current_sheet member to Workbook.
Delete some old test code.
(do_focus_sheet) : Cancel inputs and update edit area with new cell.
(workbook_focus_current_sheet) : Update current_sheet.
(workbook_get_current_sheet) : Delete.
* src/sheet.c (sheet_cursor_{move, set}) : Delete call to
gnumeric_sheet_cursor_set.
* src/sheet.c (sheet_{row,col}_add) : Use sheet_view_scrollbar_config.
We should not be touching GUI directly.
* src/sheet-view.c (sheet_view_scrollbar_config) : Set the scrollbar's
value as well as it max and page info.
* src/gnumeric-sheet.[ch] (gnumeric_sheet_cursor_set) : Delete.
The scrollbars reflect the visible range, not the cursor cell.
* src/item-cursor.c (item_cursor_set_bounds_visibly) : Remove call to
gnumeric_sheet_cursor_set.
2000-01-27 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/dialog-advanced-filter.c, src/func.h, src/workbook.c:
......@@ -18,6 +44,14 @@
2000-01-26 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_workbook_write) : Do not save the current
edit-text. We don't save the current cell or the current selection
so restoring the text of the ex-cursor is quite confusing.
(xml_workbook_read) : Restore window size.
(gnumeric_xml_sheet_{read,write}) : Delete unused.
(xml_get_range) : Utility routine.
(xml_read_selection_info) : Utility routine to restore the selection.
* src/sheet.c (sheet_{insert,delete}_{cols,rows}) : Do the
insert/delete even if it looks like there are no cells there.
There may be styles.
......
2000-01-27 Jody Goldberg <jgoldberg@home.com>
* *.c : convert to using Workbook::current_sheet rather than
workbook_get_current_sheet.
* src/workbook.c : Add a current_sheet member to Workbook.
Delete some old test code.
(do_focus_sheet) : Cancel inputs and update edit area with new cell.
(workbook_focus_current_sheet) : Update current_sheet.
(workbook_get_current_sheet) : Delete.
* src/sheet.c (sheet_cursor_{move, set}) : Delete call to
gnumeric_sheet_cursor_set.
* src/sheet.c (sheet_{row,col}_add) : Use sheet_view_scrollbar_config.
We should not be touching GUI directly.
* src/sheet-view.c (sheet_view_scrollbar_config) : Set the scrollbar's
value as well as it max and page info.
* src/gnumeric-sheet.[ch] (gnumeric_sheet_cursor_set) : Delete.
The scrollbars reflect the visible range, not the cursor cell.
* src/item-cursor.c (item_cursor_set_bounds_visibly) : Remove call to
gnumeric_sheet_cursor_set.
2000-01-27 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/dialog-advanced-filter.c, src/func.h, src/workbook.c:
......@@ -18,6 +44,14 @@
2000-01-26 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_workbook_write) : Do not save the current
edit-text. We don't save the current cell or the current selection
so restoring the text of the ex-cursor is quite confusing.
(xml_workbook_read) : Restore window size.
(gnumeric_xml_sheet_{read,write}) : Delete unused.
(xml_get_range) : Utility routine.
(xml_read_selection_info) : Utility routine to restore the selection.
* src/sheet.c (sheet_{insert,delete}_{cols,rows}) : Do the
insert/delete even if it looks like there are no cells there.
There may be styles.
......
......@@ -137,11 +137,9 @@ documentation for these:
formulas with an equal sign. So to enter an expression you have
to enter for example: =1+2.
- Control-Space selects a column.
- Control-A selects all.
- Shift-Space selects the row.
- Control-Space selects a column.
- Selection-keys + control extend the selection to boundary of
worksheet.
......@@ -159,8 +157,9 @@ documentation for these:
'array-formula'.
- Control-Pg{Up,Down}: Switch to the previous/next worksheet.
- Alt-Pg{Up,Down}: Page left and right.
- Mouse-Wheel : scroll up/down
- Alt-Mouse-Wheel : scroll left-right
o Auto-convert-on-input features: When you enter text in Gnumeric
it is now matched against the known formats of Gnumeric and if
......
......@@ -2853,30 +2853,25 @@ write_sheet_tail (BiffPut *bp, ExcelSheet *sheet)
{
guint8 *data;
eBiff_version ver = sheet->wb->ver;
guint16 options = 0x2b6; /* Arabic ? */
if (sheet->gnum_sheet == sheet->wb->gnum_wb->current_sheet)
options |= 0x400;
write_window1 (bp, ver);
/* See: S59E18.HTM */
if (ver <= eBiffV7) {
guint16 options = 0x2b6; /* Arabic ? */
data = ms_biff_put_len_next (bp, BIFF_WINDOW2, 10);
if (sheet->gnum_sheet ==
workbook_get_current_sheet (sheet->wb->gnum_wb))
options |= 0x400;
MS_OLE_SET_GUINT16 (data + 0, options);
MS_OLE_SET_GUINT16 (data + 2, 0x0);
MS_OLE_SET_GUINT32 (data + 4, 0x0);
MS_OLE_SET_GUINT16 (data + 8, 0x0);
ms_biff_put_commit (bp);
} else {
guint16 options = 0x2b6;
data = ms_biff_put_len_next (bp, BIFF_WINDOW2, 18);
if (sheet->gnum_sheet ==
workbook_get_current_sheet (sheet->wb->gnum_wb))
options |= 0x400;
MS_OLE_SET_GUINT16 (data + 0, options);
MS_OLE_SET_GUINT16 (data + 2, 0x0);
MS_OLE_SET_GUINT32 (data + 4, 0x0);
......
......@@ -42,7 +42,7 @@ display_recordset (Gda_Recordset* rs, Sheet* sheet, gint col, gint row)
gchar* retval;
Gda_Field* field;
sheet = workbook_get_current_sheet(current_workbook);
sheet = current_workbook->current_sheet;
field = gda_recordset_field_idx(rs, 0);
retval = gda_field_name(field);
......
......@@ -139,7 +139,7 @@ epsf_write_wb (Workbook *wb, const char *filename)
if (!fp)
return -1;
sheet = workbook_get_current_sheet (wb);
sheet = wb->current_sheet;
if (sheet) {
/* EPS does not allow more than one page, so we use
* the current sheet as the one for the EPS..
......
......@@ -778,9 +778,16 @@ cmd_clear_selection (CommandContext *context, Sheet *sheet, int const clear_flag
#define CMD_FORMAT_TYPE (cmd_format_get_type ())
#define CMD_FORMAT(o) (GTK_CHECK_CAST ((o), CMD_FORMAT_TYPE, CmdFormat))
struct StyleRange
{
Range region;
GList *styles;
};
typedef struct
{
GnumericCommand parent;
GList *contents;
} CmdFormat;
GNUMERIC_MAKE_COMMAND (CmdFormat, cmd_format);
......
......@@ -99,7 +99,7 @@ static GNOME_Gnumeric_Sheet
Workbook_sheet_current (PortableServer_Servant servant, CORBA_Environment * ev)
{
Workbook *wb = workbook_from_servant (servant);
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
return corba_sheet (sheet, ev);
}
......
......@@ -81,7 +81,7 @@ advanced_filter (Workbook *wb,
if (cols != criteria_col_e - criteria_col_b)
return N_COLUMNS_ERROR;
sheet = workbook_get_current_sheet (wb);
sheet = wb->current_sheet;
criteria = parse_criteria_range (sheet, criteria_col_b,
criteria_row_b, criteria_col_e,
criteria_row_e, NULL);
......@@ -218,7 +218,7 @@ dialog_advanced_filter (Workbook *wb)
loop:
v = gnumeric_dialog_run (wb, GNOME_DIALOG (dia));
sheet = workbook_get_current_sheet (wb);
sheet = wb->current_sheet;
if (v == 1) {
/* Canceled */
......
......@@ -34,7 +34,7 @@ update_edit (state_t *state)
EvalPosition ep;
char *txt;
sheet = workbook_get_current_sheet (state->wb);
sheet = state->wb->current_sheet;
g_return_if_fail (sheet != NULL);
eval_pos_init (&ep, sheet, 0, 0);
......
......@@ -79,46 +79,6 @@ gnumeric_sheet_get_cell_bounds (GnumericSheet *gsheet, int col, int row, int *x,
*h = sheet_row_get_distance (sheet, row, row + 1);
}
/*
* gnumeric_sheet_cursor_set
* @gsheet: The sheet
* @col: the column
* @row: the row
*
* This informs the GnumericSheet of the cursor position. It is
* used to sync the contents of the scrollbars with our position
*/
void
gnumeric_sheet_cursor_set (GnumericSheet *gsheet, int col, int row)
{
GtkAdjustment *ha, *va;
SheetView *sheet_view;
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
sheet_view = gsheet->sheet_view;
if (sheet_view->ha){
ha = GTK_ADJUSTMENT (sheet_view->ha);
va = GTK_ADJUSTMENT (sheet_view->va);
ha->value = gsheet->col.first;
va->value = gsheet->row.first;
#ifdef DEBUG_POSITIONS
{
char *top_str = g_strdup (cell_name (gsheet->col.first, gsheet->row.first));
char *lv_str = g_strdup (cell_name (gsheet->col.last_visible, gsheet->row.last_visible));
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 (va);
}
}
/*
* gnumeric_sheet_set_selection:
* @gsheet: The sheet name
......
......@@ -51,8 +51,6 @@ GtkWidget *gnumeric_sheet_new (SheetView *sheet, ItemBar *colbar, I
void gnumeric_sheet_set_selection (GnumericSheet *gsheet, SheetSelection const *ss);
void gnumeric_sheet_set_top_row (GnumericSheet *gsheet, int new_first_row);
void gnumeric_sheet_set_left_col (GnumericSheet *gsheet, int new_first_col);
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);
......
......@@ -79,46 +79,6 @@ gnumeric_sheet_get_cell_bounds (GnumericSheet *gsheet, int col, int row, int *x,
*h = sheet_row_get_distance (sheet, row, row + 1);
}
/*
* gnumeric_sheet_cursor_set
* @gsheet: The sheet
* @col: the column
* @row: the row
*
* This informs the GnumericSheet of the cursor position. It is
* used to sync the contents of the scrollbars with our position
*/
void
gnumeric_sheet_cursor_set (GnumericSheet *gsheet, int col, int row)
{
GtkAdjustment *ha, *va;
SheetView *sheet_view;
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
sheet_view = gsheet->sheet_view;
if (sheet_view->ha){
ha = GTK_ADJUSTMENT (sheet_view->ha);
va = GTK_ADJUSTMENT (sheet_view->va);
ha->value = gsheet->col.first;
va->value = gsheet->row.first;
#ifdef DEBUG_POSITIONS
{
char *top_str = g_strdup (cell_name (gsheet->col.first, gsheet->row.first));
char *lv_str = g_strdup (cell_name (gsheet->col.last_visible, gsheet->row.last_visible));
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 (va);
}
}
/*
* gnumeric_sheet_set_selection:
* @gsheet: The sheet name
......
......@@ -51,8 +51,6 @@ GtkWidget *gnumeric_sheet_new (SheetView *sheet, ItemBar *colbar, I
void gnumeric_sheet_set_selection (GnumericSheet *gsheet, SheetSelection const *ss);
void gnumeric_sheet_set_top_row (GnumericSheet *gsheet, int new_first_row);
void gnumeric_sheet_set_left_col (GnumericSheet *gsheet, int new_first_col);
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);
......
......@@ -752,7 +752,6 @@ item_cursor_set_bounds_visibly (ItemCursor *item_cursor,
item_cursor_set_bounds (item_cursor, start_col, start_row, end_col, end_row);
gnumeric_sheet_make_cell_visible (gsheet, base_col, base_row, FALSE);
gnumeric_sheet_cursor_set (gsheet, base_col, base_row);
gnome_canvas_update_now (GNOME_CANVAS (gsheet));
}
......
......@@ -1097,9 +1097,10 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
row = MIN (gsheet->row.last_full , SHEET_MAX_ROWS-1);
gnumeric_sheet_set_top_row (gsheet, row);
}
return 1;
return TRUE;
default:
return 0;
return FALSE;
};
break;
......
......@@ -273,6 +273,7 @@ sheet_view_scrollbar_config (SheetView const *sheet_view)
sheet_view->sheet->rows.max_used),
sheet->cursor_row);
va->page_size = last_row - gsheet->row.first;
va->value = gsheet->row.first;
va->step_increment = va->page_increment =
va->page_size / 2;
......@@ -280,6 +281,7 @@ sheet_view_scrollbar_config (SheetView const *sheet_view)
sheet_view->sheet->cols.max_used),
sheet->cursor_col);
ha->page_size = last_col - gsheet->col.first;
ha->value = gsheet->col.first;
ha->step_increment = ha->page_increment =
ha->page_size / 2;
......
......@@ -273,6 +273,7 @@ sheet_view_scrollbar_config (SheetView const *sheet_view)
sheet_view->sheet->rows.max_used),
sheet->cursor_row);
va->page_size = last_row - gsheet->row.first;
va->value = gsheet->row.first;
va->step_increment = va->page_increment =
va->page_size / 2;
......@@ -280,6 +281,7 @@ sheet_view_scrollbar_config (SheetView const *sheet_view)
sheet_view->sheet->cols.max_used),
sheet->cursor_col);
ha->page_size = last_col - gsheet->col.first;
ha->value = gsheet->col.first;
ha->step_increment = ha->page_increment =
ha->page_size / 2;
......
......@@ -399,12 +399,7 @@ sheet_col_add (Sheet *sheet, ColRowInfo *cp)
for (l = sheet->sheet_views; l; l = l->next){
SheetView *sheet_view = l->data;
GtkAdjustment *ha = GTK_ADJUSTMENT (sheet_view->ha);
if (sheet->cols.max_used > ha->upper){
ha->upper = col;
gtk_adjustment_changed (ha);
}
sheet_view_scrollbar_config (sheet_view);
}
}
}
......@@ -429,12 +424,7 @@ sheet_row_add (Sheet *sheet, ColRowInfo *rp)
for (l = sheet->sheet_views; l; l = l->next){
SheetView *sheet_view = l->data;
GtkAdjustment *va = GTK_ADJUSTMENT (sheet_view->va);
if (sheet->rows.max_used > va->upper){
va->upper = row;
gtk_adjustment_changed (va);
}
sheet_view_scrollbar_config (sheet_view);
}
}
}
......@@ -2744,7 +2734,6 @@ sheet_cursor_move (Sheet *sheet, int col, int row,
for (l = sheet->sheet_views; l; l = l->next){
GnumericSheet *gsheet = GNUMERIC_SHEET_VIEW (l->data);
gnumeric_sheet_cursor_set (gsheet, col, row);
gnumeric_sheet_set_cursor_bounds (gsheet, col, row, col, row);
}
sheet_load_cell_val (sheet);
......@@ -2775,7 +2764,6 @@ sheet_cursor_set (Sheet *sheet, int base_col, int base_row, int start_col, int s
for (l = sheet->sheet_views; l; l = l->next){
GnumericSheet *gsheet = GNUMERIC_SHEET_VIEW (l->data);
gnumeric_sheet_cursor_set (gsheet, base_col, base_row);
gnumeric_sheet_set_cursor_bounds (
gsheet,
start_col, start_row,
......
......@@ -20,7 +20,7 @@
void
workbook_cmd_format_column_auto_fit (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
GList *l;
int col;
......@@ -46,7 +46,7 @@ workbook_cmd_format_column_auto_fit (GtkWidget *widget, Workbook *wb)
void
workbook_cmd_format_column_width (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
GList *l;
double value = 0.0;
int col;
......@@ -105,7 +105,7 @@ workbook_cmd_format_column_width (GtkWidget *widget, Workbook *wb)
void
workbook_cmd_format_row_auto_fit (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
GList *l;
int row;
......@@ -131,7 +131,7 @@ workbook_cmd_format_row_auto_fit (GtkWidget *widget, Workbook *wb)
void
workbook_cmd_format_row_height (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
GList *l;
double value = 0.0;
......@@ -189,7 +189,7 @@ workbook_cmd_format_row_height (GtkWidget *widget, Workbook *wb)
void
workbook_cmd_format_sheet_change_name (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
char *new_name;
new_name = dialog_get_sheet_name (wb, sheet->name);
......@@ -205,7 +205,7 @@ void
workbook_cmd_format_column_hide (GtkWidget *widget, Workbook *wb)
{
cmd_hide_selection_rows_cols (workbook_command_context_gui (wb),
workbook_get_current_sheet (wb),
wb->current_sheet,
TRUE, FALSE);
}
......@@ -213,7 +213,7 @@ void
workbook_cmd_format_column_unhide (GtkWidget *widget, Workbook *wb)
{
cmd_hide_selection_rows_cols (workbook_command_context_gui (wb),
workbook_get_current_sheet (wb),
wb->current_sheet,
TRUE, TRUE);
}
......@@ -227,7 +227,7 @@ void
workbook_cmd_format_row_hide (GtkWidget *widget, Workbook *wb)
{
cmd_hide_selection_rows_cols (workbook_command_context_gui (wb),
workbook_get_current_sheet (wb),
wb->current_sheet,
FALSE, FALSE);
}
......@@ -235,7 +235,7 @@ void
workbook_cmd_format_row_unhide (GtkWidget *widget, Workbook *wb)
{
cmd_hide_selection_rows_cols (workbook_command_context_gui (wb),
workbook_get_current_sheet (wb),
wb->current_sheet,
FALSE, TRUE);
}
......
......@@ -40,7 +40,7 @@ set_selection_halign (Workbook *wb, StyleHAlignFlags align)
MStyle *mstyle;
Sheet *sheet;
sheet = workbook_get_current_sheet (wb);
sheet = wb->current_sheet;
application_clipboard_unant ();
mstyle = mstyle_new ();
......@@ -80,7 +80,7 @@ change_selection_font (Workbook *wb, int bold, int italic)
MStyle *mstyle;
Sheet *sheet;
sheet = workbook_get_current_sheet (wb);
sheet = wb->current_sheet;
application_clipboard_unant ();
if (bold >= 0) {
......@@ -117,7 +117,7 @@ change_font_in_selection_cmd (GtkMenuItem *item, Workbook *wb)
wb->priv->current_font_name = font_name;
sheet = workbook_get_current_sheet (wb);
sheet = wb->current_sheet;
mstyle = mstyle_new ();
mstyle_set_font_name (mstyle, font_name);
......@@ -127,7 +127,7 @@ change_font_in_selection_cmd (GtkMenuItem *item, Workbook *wb)
static void
change_font_size_in_selection_cmd (GtkEntry *entry, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
MStyle *mstyle;
double size;
......@@ -165,7 +165,7 @@ do_sheet_selection_apply_style (Sheet *sheet, const char *format)
static void
workbook_cmd_format_as_money (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
do_sheet_selection_apply_style (sheet, _(money_format));
}
......@@ -173,7 +173,7 @@ workbook_cmd_format_as_money (GtkWidget *widget, Workbook *wb)
static void
workbook_cmd_format_as_percent (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
do_sheet_selection_apply_style (sheet, _(percent_format));
}
......@@ -227,7 +227,7 @@ modify_cell_region (Sheet *sheet,
static void
do_modify_format (Workbook *wb, format_modify_fn modify_fn)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
selection_apply (sheet, modify_cell_region, FALSE, modify_fn);
sheet_set_dirty (sheet, TRUE);
......@@ -297,7 +297,7 @@ static GnomeUIInfo workbook_format_toolbar [] = {
static void
fore_color_changed (ColorCombo *cc, GdkColor *color, int color_index, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
MStyle *mstyle = mstyle_new ();
mstyle_set_color (mstyle, MSTYLE_COLOR_FORE,
......@@ -309,7 +309,7 @@ fore_color_changed (ColorCombo *cc, GdkColor *color, int color_index, Workbook *
static void
back_color_changed (ColorCombo *cc, GdkColor *color, int color_index, Workbook *wb)
{
Sheet *sheet = workbook_get_current_sheet (wb);
Sheet *sheet = wb->current_sheet;
MStyle *mstyle = mstyle_new ();
if (color_index >= 0) {
......
......@@ -87,6 +87,7 @@ struct _Workbook {
/* The sheets */
GHashTable *sheets; /* keeps a list of the Sheets on this workbook */
Sheet *current_sheet;
/* User defined names */
GList *names;
......@@ -150,7 +151,6 @@ void workbook_attach_sheet (Workbook *, Sheet *);
gboolean workbook_detach_sheet (Workbook *, Sheet *, gboolean);
Sheet *workbook_focus_current_sheet (Workbook *wb);
void workbook_focus_sheet (Sheet *sheet);
Sheet *workbook_get_current_sheet (Workbook *wb);
char *workbook_sheet_get_free_name (Workbook *wb);
void workbook_auto_expr_label_set (Workbook *wb, const char *text);
void workbook_set_region_status (Workbook *wb, const char *str);
......
......@@ -170,18 +170,14 @@ about_cmd (GtkWidget *widget, Workbook *wb)
static void
create_graphic_cmd (GtkWidget *widget, Workbook *wb)
{
Sheet *sheet;
sheet = workbook_get_current_sheet (wb);