Commit 5c3d4bf0 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

fix chema's spanning problem.


2001-04-10  Jody Goldberg <jgoldberg@home.com>

	* src/cellspan.c (cell_calc_span) : fix chema's spanning problem.

	* src/workbook-control-gui.c (workbook_menu_data) : Add an icon for
	  the sort menu item.

2001-04-9  Jody Goldberg <jgoldberg@home.com>

	s/cmd_hide_selection_colrow/cmd_colrow_hide_selection/

	* src/commands.c (cmd_colrow_outline_change) : new wrapper for
	  colrow_hide that handled outline changes.

	* src/workbook-control-gui.c (cb_insert_{cols,rows}) : cancel edit.
	(cb_select_auto_expr) : return a value.

	* src/colrow.c (cb_col_row_visibility) : Use get rather than fetch.
	(colrow_find_outline_bound) : new function.
	(cb_colrow_visibility) : turn this into a wrapper for.
	(colrow_visibility) : this, and add honour_collapse flag.
	  invert the search to go fro mthe end to the start in preparation for
	  supporting the honour_collapse flag.  Insert the items into a sorted
	  list in case we want to merge them some day.
	(colrow_get_outline_toggle) : use new routine here too.

2001-04-05  Jody Goldberg <jgoldberg@home.com>

	* src/item-bar.c (item_bar_event) : Doh!  The outline events are
	  controled by the minor coordinate.

2001-04-01  Jody Goldberg <jgoldberg@home.com>

	* src/main.c (gnumeric_main) : shut plugins down first.
parent ca1cf5ef
......@@ -8,9 +8,22 @@ release, and longer term bugs.
Release Critical
----------------
- Figure out what to do in src/style.c now that gnome-print installs a
fontmap2 file.
- rename gnumeric.xml
- defining file patterns in plugin spec overrides 'has_probe' flag silently.
- pasting with singleton destination circumvents checks for arrays and
merged cells.
- Get the i18n XL patches verified and in
- Fix XL named expr import for sheet local names
- #52753 Figure out the GAL colour combo problem that activates all
workbooks together when only 1 changes.
- Figure out what to do in src/style.c now that gnome-print installs a
fontmap2 file.
Long term breakage
------------------
......
2001-04-10 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_calc_span) : fix chema's spanning problem.
* src/workbook-control-gui.c (workbook_menu_data) : Add an icon for
the sort menu item.
2001-04-9 Jody Goldberg <jgoldberg@home.com>
s/cmd_hide_selection_colrow/cmd_colrow_hide_selection/
* src/commands.c (cmd_colrow_outline_change) : new wrapper for
colrow_hide that handled outline changes.
* src/workbook-control-gui.c (cb_insert_{cols,rows}) : cancel edit.
(cb_select_auto_expr) : return a value.
* src/colrow.c (cb_col_row_visibility) : Use get rather than fetch.
(colrow_find_outline_bound) : new function.
(cb_colrow_visibility) : turn this into a wrapper for.
(colrow_visibility) : this, and add honour_collapse flag.
invert the search to go fro mthe end to the start in preparation for
supporting the honour_collapse flag. Insert the items into a sorted
list in case we want to merge them some day.
(colrow_get_outline_toggle) : use new routine here too.
2001-04-05 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_event) : Doh! The outline events are
controled by the minor coordinate.
2001-04-01 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : shut plugins down first.
2001-04-04 Morten Welinder <terra@diku.dk>
* src/style.c (font_init): Improve error message. Constify.
......
......@@ -5,6 +5,7 @@ Jody:
* Restore horizontal FILL alignment.
* Fix array intercept checking.
* Some XL import improvement when parsing objects.
* Some fine tuning to improve start and exit times.
Morten:
* Make search-and-destroy work better on comments.
......
2001-04-10 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_calc_span) : fix chema's spanning problem.
* src/workbook-control-gui.c (workbook_menu_data) : Add an icon for
the sort menu item.
2001-04-9 Jody Goldberg <jgoldberg@home.com>
s/cmd_hide_selection_colrow/cmd_colrow_hide_selection/
* src/commands.c (cmd_colrow_outline_change) : new wrapper for
colrow_hide that handled outline changes.
* src/workbook-control-gui.c (cb_insert_{cols,rows}) : cancel edit.
(cb_select_auto_expr) : return a value.
* src/colrow.c (cb_col_row_visibility) : Use get rather than fetch.
(colrow_find_outline_bound) : new function.
(cb_colrow_visibility) : turn this into a wrapper for.
(colrow_visibility) : this, and add honour_collapse flag.
invert the search to go fro mthe end to the start in preparation for
supporting the honour_collapse flag. Insert the items into a sorted
list in case we want to merge them some day.
(colrow_get_outline_toggle) : use new routine here too.
2001-04-05 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_event) : Doh! The outline events are
controled by the minor coordinate.
2001-04-01 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : shut plugins down first.
2001-04-04 Morten Welinder <terra@diku.dk>
* src/style.c (font_init): Improve error message. Constify.
......
2001-04-10 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_calc_span) : fix chema's spanning problem.
* src/workbook-control-gui.c (workbook_menu_data) : Add an icon for
the sort menu item.
2001-04-9 Jody Goldberg <jgoldberg@home.com>
s/cmd_hide_selection_colrow/cmd_colrow_hide_selection/
* src/commands.c (cmd_colrow_outline_change) : new wrapper for
colrow_hide that handled outline changes.
* src/workbook-control-gui.c (cb_insert_{cols,rows}) : cancel edit.
(cb_select_auto_expr) : return a value.
* src/colrow.c (cb_col_row_visibility) : Use get rather than fetch.
(colrow_find_outline_bound) : new function.
(cb_colrow_visibility) : turn this into a wrapper for.
(colrow_visibility) : this, and add honour_collapse flag.
invert the search to go fro mthe end to the start in preparation for
supporting the honour_collapse flag. Insert the items into a sorted
list in case we want to merge them some day.
(colrow_get_outline_toggle) : use new routine here too.
2001-04-05 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_event) : Doh! The outline events are
controled by the minor coordinate.
2001-04-01 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : shut plugins down first.
2001-04-04 Morten Welinder <terra@diku.dk>
* src/style.c (font_init): Improve error message. Constify.
......
2001-04-10 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_calc_span) : fix chema's spanning problem.
* src/workbook-control-gui.c (workbook_menu_data) : Add an icon for
the sort menu item.
2001-04-9 Jody Goldberg <jgoldberg@home.com>
s/cmd_hide_selection_colrow/cmd_colrow_hide_selection/
* src/commands.c (cmd_colrow_outline_change) : new wrapper for
colrow_hide that handled outline changes.
* src/workbook-control-gui.c (cb_insert_{cols,rows}) : cancel edit.
(cb_select_auto_expr) : return a value.
* src/colrow.c (cb_col_row_visibility) : Use get rather than fetch.
(colrow_find_outline_bound) : new function.
(cb_colrow_visibility) : turn this into a wrapper for.
(colrow_visibility) : this, and add honour_collapse flag.
invert the search to go fro mthe end to the start in preparation for
supporting the honour_collapse flag. Insert the items into a sorted
list in case we want to merge them some day.
(colrow_get_outline_toggle) : use new routine here too.
2001-04-05 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_event) : Doh! The outline events are
controled by the minor coordinate.
2001-04-01 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : shut plugins down first.
2001-04-04 Morten Welinder <terra@diku.dk>
* src/style.c (font_init): Improve error message. Constify.
......
2001-04-10 Jody Goldberg <jgoldberg@home.com>
* src/cellspan.c (cell_calc_span) : fix chema's spanning problem.
* src/workbook-control-gui.c (workbook_menu_data) : Add an icon for
the sort menu item.
2001-04-9 Jody Goldberg <jgoldberg@home.com>
s/cmd_hide_selection_colrow/cmd_colrow_hide_selection/
* src/commands.c (cmd_colrow_outline_change) : new wrapper for
colrow_hide that handled outline changes.
* src/workbook-control-gui.c (cb_insert_{cols,rows}) : cancel edit.
(cb_select_auto_expr) : return a value.
* src/colrow.c (cb_col_row_visibility) : Use get rather than fetch.
(colrow_find_outline_bound) : new function.
(cb_colrow_visibility) : turn this into a wrapper for.
(colrow_visibility) : this, and add honour_collapse flag.
invert the search to go fro mthe end to the start in preparation for
supporting the honour_collapse flag. Insert the items into a sorted
list in case we want to merge them some day.
(colrow_get_outline_toggle) : use new routine here too.
2001-04-05 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_event) : Doh! The outline events are
controled by the minor coordinate.
2001-04-01 Jody Goldberg <jgoldberg@home.com>
* src/main.c (gnumeric_main) : shut plugins down first.
2001-04-04 Morten Welinder <terra@diku.dk>
* src/style.c (font_init): Improve error message. Constify.
......
......@@ -314,7 +314,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
} else
remain_left = 0;
} else
margin_a = ci->margin_a;
pos_l = margin_a = ci->margin_a;
} else
remain_left = 0;
......@@ -328,7 +328,7 @@ cell_calc_span (Cell const * const cell, int * const col1, int * const col2)
margin_b = ci->margin_b;
*col2 = pos_r;
} else
remain_right = 0;
max_col = remain_right = 0;
} else
margin_b = ci->margin_b;
} else
......
......@@ -411,55 +411,91 @@ rows_height_update (Sheet *sheet, Range const * range)
}
/*****************************************************************************/
struct col_row_visiblity
struct colrow_visiblity
{
gboolean is_cols, visible;
ColRowVisList *elements;
};
static gint
colrow_index_cmp (ColRowIndex const *a, ColRowIndex const *b)
{
/* We can be very simplistic here because the ranges never overlap */
return b->first - a->first;
}
static void
cb_col_row_visibility (Sheet *sheet, Range const *r,
void *closure)
colrow_visibility (Sheet const *sheet, struct colrow_visiblity * const dat,
int first, int last, gboolean honour_collapse)
{
struct col_row_visiblity * const dat = closure;
int i;
gboolean const visible = dat->visible;
ColRowInfo * (*fetch) (Sheet *sheet, int pos);
int i, j, end;
ColRowInfo * (*get) (Sheet const *sheet, int pos) = (dat->is_cols)
? &sheet_col_get : &sheet_row_get;
if (dat->is_cols) {
i = r->start.col;
end = r->end.col;
fetch = &sheet_col_fetch;
} else {
i = r->start.row;
end = r->end.row;
fetch = &sheet_row_fetch;
}
/* Find the end of a segment that will be toggled */
for (i = last; i>=first; --i) {
int j;
ColRowIndex *res;
ColRowInfo const *cri = (*get) (sheet, i);
/* Find the begining of a segment that will be toggled */
for (;i <= end ; ++i) {
ColRowInfo *cri = (*fetch) (sheet, i);
if ((visible == 0) != (cri->visible == 0)) {
ColRowIndex *res = g_new(ColRowIndex, 1);
if (cri == NULL) {
if (visible != 0)
continue;
} else if ((visible != 0) == (cri->visible != 0))
continue;
/* Find the end */
for (j = i+1; j <= end ; ++j) {
ColRowInfo * cri = (*fetch) (sheet, j);
if ((visible == 0) == (cri->visible == 0))
break;
}
res->first = i;
res->last = j - 1;
/* Find the begining */
for (j = i-1; j >= first ; --j) {
ColRowInfo const * cri = (*get) (sheet, j);
if (cri == NULL) {
if (visible != 0)
break;
} else if ((visible != 0) == (cri->visible != 0))
break;
}
res = g_new (ColRowIndex, 1);
res->first = j + 1;
res->last = i;
#if 0
printf ("%d %d\n", res->index, res->count);
printf ("%d %d\n", res->index, res->count);
#endif
dat->elements = g_slist_prepend (dat->elements, res);
i = j;
}
dat->elements = g_slist_insert_sorted (dat->elements, res,
(GCompareFunc)colrow_index_cmp);
i = j;
}
}
ColRowVisList *
colrow_get_outline_toggle (Sheet const *sheet, gboolean is_cols, gboolean visible,
int first, int last)
{
struct colrow_visiblity closure;
closure.is_cols = is_cols;
closure.visible = visible;
closure.elements = NULL;
colrow_visibility (sheet, &closure, first, last, TRUE);
return closure.elements;
}
static void
cb_colrow_visibility (Sheet *sheet, Range const *r,
void *closure)
{
struct colrow_visiblity * const dat = (struct colrow_visiblity *)closure;
int first, last;
if (dat->is_cols) {
first = r->start.col;
last = r->end.col;
} else {
first = r->start.row;
last = r->end.row;
}
colrow_visibility (sheet, dat, first, last, FALSE);
}
/*
* colrow_get_visiblity_toggle :
* @sheet : The sheet whose selection we are interested in.
......@@ -468,17 +504,20 @@ cb_col_row_visibility (Sheet *sheet, Range const *r,
*
* Searches the selection list and generates a list of index,count
* pairs of row/col ranges that need to be hidden or unhiden.
*
* NOTE : leave sheet non-const until we have a const version of
* selection_apply.
*/
ColRowVisList *
colrow_get_visiblity_toggle (Sheet *sheet, gboolean const is_cols,
gboolean const visible)
colrow_get_visiblity_toggle (Sheet *sheet, gboolean is_cols,
gboolean visible)
{
struct col_row_visiblity closure;
struct colrow_visiblity closure;
closure.is_cols = is_cols;
closure.visible = visible;
closure.elements = NULL;
selection_apply (sheet, &cb_col_row_visibility, FALSE, &closure);
selection_apply (sheet, &cb_colrow_visibility, FALSE, &closure);
return closure.elements;
}
......@@ -515,19 +554,50 @@ colrow_set_visibility_list (Sheet *sheet, gboolean const is_cols,
info->first, info->last);
}
for (ptr = list; ptr != NULL ; ptr = ptr->next) {
int min_col, max_col;
ColRowIndex *info = ptr->data;
sheet_regen_adjacent_spans (sheet,
info->first, 0,
info->last, SHEET_MAX_ROWS-1,
&min_col, &max_col);
}
if (is_cols)
for (ptr = list; ptr != NULL ; ptr = ptr->next) {
int min_col, max_col;
ColRowIndex *info = ptr->data;
sheet_regen_adjacent_spans (sheet,
info->first, 0,
info->last, SHEET_MAX_ROWS-1,
&min_col, &max_col);
}
sheet_redraw_all (sheet);
sheet_redraw_headers (sheet, TRUE, TRUE, NULL);
}
/**
* colrow_find_outline_bound :
*
* find the next/prev col/row at the designated depth starting from the
* supplied @index.
*/
int
colrow_find_outline_bound (Sheet const *sheet, gboolean is_cols,
int index, int depth, gboolean inc)
{
ColRowInfo * (*get) (Sheet const *sheet, int pos) = is_cols
? &sheet_col_get : &sheet_row_get;
int const max = is_cols ? SHEET_MAX_COLS : SHEET_MAX_ROWS;
int const step = inc ? 1 : -1;
while (1) {
ColRowInfo const *cri;
int const next = index + step;
if (next < 0 || next >= max)
return index;
cri = (*get) (sheet, next);
if (cri == NULL || cri->outline_level < depth)
return index;
index = next;
}
return index;
}
/**
* colrow_find_adjacent_visible:
* @sheet: Sheet to search on.
......@@ -539,8 +609,8 @@ colrow_set_visibility_list (Sheet *sheet, gboolean const is_cols,
* there are no more visible cols/rows left.
**/
int
colrow_find_adjacent_visible (Sheet *sheet, gboolean const is_col, int const index,
gboolean forward)
colrow_find_adjacent_visible (Sheet *sheet, gboolean const is_col,
int const index, gboolean forward)
{
int const max = is_col ? SHEET_MAX_COLS : SHEET_MAX_ROWS;
int i = index; /* To avoid trouble at edges */
......@@ -577,8 +647,8 @@ colrow_find_adjacent_visible (Sheet *sheet, gboolean const is_col, int const ind
* Change the visibility of the selected range of contiguous rows/cols.
*/
void
colrow_set_visibility (Sheet *sheet, gboolean const is_cols, gboolean const visible,
int first, int last)
colrow_set_visibility (Sheet *sheet, gboolean const is_cols,
gboolean const visible, int first, int last)
{
int i, prev_outline = 0;
gboolean prev_changed = FALSE;
......
......@@ -76,15 +76,18 @@ void colrow_restore_sizes_group (Sheet *sheet, gboolean const is_cols,
int old_size);
/* Support for Col/Row visibility */
void colrow_set_visibility (Sheet *sheet, gboolean const is_col,
gboolean const visible,
int first, int last);
int colrow_find_outline_bound (Sheet const *sheet, gboolean is_cols,
int index, int depth, gboolean inc);
ColRowVisList *colrow_get_outline_toggle (Sheet const *sheet, gboolean is_cols,
gboolean visible, int first, int last);
ColRowVisList *colrow_get_visiblity_toggle (Sheet *sheet, gboolean is_cols,
gboolean visible);
void colrow_set_visibility (Sheet *sheet, gboolean is_cols,
gboolean visible, int first, int last);
ColRowVisList *colrow_get_visiblity_toggle (Sheet *sheet, gboolean const is_col,
gboolean const visible);
ColRowVisList *colrow_vis_list_destroy (ColRowVisList *list);
void colrow_set_visibility_list (Sheet *sheet, gboolean const is_col,
gboolean const visible,
void colrow_set_visibility_list (Sheet *sheet, gboolean is_col,
gboolean visible,
ColRowVisList *list);
/* Misc */
......
......@@ -1819,8 +1819,8 @@ cmd_sort (WorkbookControl *wbc, SortData *data)
/******************************************************************/
#define CMD_HIDE_COLROW_TYPE (cmd_hide_colrow_get_type ())
#define CMD_HIDE_COLROW(o) (GTK_CHECK_CAST ((o), CMD_HIDE_COLROW_TYPE, CmdHideColRow))
#define CMD_COLROW_HIDE_TYPE (cmd_colrow_hide_get_type ())
#define CMD_COLROW_HIDE(o) (GTK_CHECK_CAST ((o), CMD_COLROW_HIDE_TYPE, CmdColRowHide))
typedef struct
{
......@@ -1830,21 +1830,22 @@ typedef struct
gboolean is_cols;
gboolean visible;
ColRowVisList *elements;
} CmdHideColRow;
} CmdColRowHide;
GNUMERIC_MAKE_COMMAND (CmdHideColRow, cmd_hide_colrow);
GNUMERIC_MAKE_COMMAND (CmdColRowHide, cmd_colrow_hide);
static void
cmd_hide_colrow_correct_selection (GnumericCommand *cmd)
cmd_colrow_hide_correct_selection (CmdColRowHide *me)
{
CmdHideColRow *me = CMD_HIDE_COLROW (cmd);
int x, y, index;
/*
* Make sure the selection/cursor is set to a visible row/col
*/
index = colrow_find_adjacent_visible (me->sheet, me->is_cols, me->is_cols
? me->sheet->edit_pos.col : me->sheet->edit_pos.row,
index = colrow_find_adjacent_visible (me->sheet, me->is_cols,
me->is_cols
? me->sheet->edit_pos.col
: me->sheet->edit_pos.row,
TRUE);
x = me->is_cols ? me->sheet->edit_pos.row : index;
......@@ -1863,9 +1864,9 @@ cmd_hide_colrow_correct_selection (GnumericCommand *cmd)
}
static gboolean
cmd_hide_colrow_undo (GnumericCommand *cmd, WorkbookControl *wbc)
cmd_colrow_hide_undo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdHideColRow *me = CMD_HIDE_COLROW (cmd);
CmdColRowHide *me = CMD_COLROW_HIDE (cmd);
g_return_val_if_fail (me != NULL, TRUE);
......@@ -1873,15 +1874,15 @@ cmd_hide_colrow_undo (GnumericCommand *cmd, WorkbookControl *wbc)
!me->visible, me->elements);
if (me->visible == TRUE)
cmd_hide_colrow_correct_selection (cmd);
cmd_colrow_hide_correct_selection (me);
return FALSE;
}
static gboolean
cmd_hide_colrow_redo (GnumericCommand *cmd, WorkbookControl *wbc)
cmd_colrow_hide_redo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdHideColRow *me = CMD_HIDE_COLROW (cmd);
CmdColRowHide *me = CMD_COLROW_HIDE (cmd);
g_return_val_if_fail (me != NULL, TRUE);
......@@ -1889,30 +1890,30 @@ cmd_hide_colrow_redo (GnumericCommand *cmd, WorkbookControl *wbc)
me->visible, me->elements);
if (me->visible != TRUE)
cmd_hide_colrow_correct_selection (cmd);
cmd_colrow_hide_correct_selection (me);
return FALSE;
}
static void
cmd_hide_colrow_destroy (GtkObject *cmd)
cmd_colrow_hide_destroy (GtkObject *cmd)
{
CmdHideColRow *me = CMD_HIDE_COLROW (cmd);
CmdColRowHide *me = CMD_COLROW_HIDE (cmd);
me->elements = colrow_vis_list_destroy (me->elements);
gnumeric_command_destroy (cmd);
}
gboolean
cmd_hide_selection_colrow (WorkbookControl *wbc, Sheet *sheet,
cmd_colrow_hide_selection (WorkbookControl *wbc, Sheet *sheet,
gboolean is_cols, gboolean visible)
{
GtkObject *obj;
CmdHideColRow *me;
CmdColRowHide *me;
g_return_val_if_fail (sheet != NULL, TRUE);
obj = gtk_type_new (CMD_HIDE_COLROW_TYPE);
me = CMD_HIDE_COLROW (obj);
obj = gtk_type_new (CMD_COLROW_HIDE_TYPE);
me = CMD_COLROW_HIDE (obj);
me->sheet = sheet;
me->is_cols = is_cols;
......@@ -1929,6 +1930,63 @@ cmd_hide_selection_colrow (WorkbookControl *wbc, Sheet *sheet,
return command_push_undo (wbc, obj);
}
gboolean
cmd_colrow_outline_change (WorkbookControl *wbc, Sheet *sheet,
gboolean is_cols, int index, int depth)
{
GtkObject *obj;
CmdColRowHide *me;
ColRowInfo const *cri;
int first = -1, last = -1;
gboolean visible;
g_return_val_if_fail (sheet != NULL, TRUE);
cri = is_cols ? sheet_col_get (sheet, index)
: sheet_row_get (sheet, index);
if (index > 0) {
ColRowInfo const *prev = is_cols ? sheet_col_get (sheet, index-1)
: sheet_row_get (sheet, index-1);
if (prev != NULL && prev->outline_level > depth) {
visible = (cri != NULL) ? cri->is_collapsed : FALSE;
last = index - 1;
first = colrow_find_outline_bound (sheet, is_cols, index-1,
depth, FALSE);
}
}
if (first < 0 && cri != NULL && cri->outline_level > 0) {
first = colrow_find_outline_bound (sheet, is_cols, index, depth, FALSE);
last = colrow_find_outline_bound (sheet, is_cols, index, depth, TRUE);
visible = FALSE;
if (first == last && depth > cri->outline_level)
first = last = -1;
}
if (first < 0 || last < 0)
return TRUE;
obj = gtk_type_new (CMD_COLROW_HIDE_TYPE);
me = CMD_COLROW_HIDE (obj);
me->sheet = sheet;
me->is_cols = is_cols;
me->visible = visible;
me->elements = colrow_get_outline_toggle (sheet, is_cols, visible,
first, last);
me->parent.sheet = sheet;
me->parent.size = 1 + g_slist_length (me->elements);
me->parent.cmd_descriptor = g_strdup (is_cols
? (visible ? _("Expand columns") : _("Collapse columns"))
: (visible ? _("Expand rows") : _("Collapse rows")));
/* Register the command object */
return command_push_undo (wbc, obj);
}
/******************************************************************/
#define CMD_PASTE_CUT_TYPE (cmd_paste_cut_get_type ())
......
......@@ -55,8 +55,10 @@ gboolean cmd_clear_selection (WorkbookControl *wbc, Sheet *sheet,
gboolean cmd_autoformat (WorkbookControl *wbc, Sheet *sheet, FormatTemplate *ft);
gboolean cmd_hide_selection_colrow (WorkbookControl *wbc, Sheet *sheet,
gboolean cmd_colrow_hide_selection (WorkbookControl *wbc, Sheet *sheet,
gboolean is_cols, gboolean visible);
gboolean cmd_colrow_outline_change (WorkbookControl *wbc, Sheet *sheet,
gboolean is_cols, int index, int depth);
gboolean cmd_merge_cells (WorkbookControl *wbc, Sheet *sheet,
GList const *selection);
......
......@@ -19,6 +19,7 @@
#include "gnumeric-type-util.h"
#include "gnumeric-util.h"
#include "parse-util.h"
#include "commands.h"
/* The signals we emit */
enum {
......@@ -720,7 +721,8 @@ outline_button_press (ItemBar const *ib, int element, int pixel)
step = pixel / inc;
printf ("%d @ %d\n", element+1, step);
cmd_colrow_outline_change (WORKBOOK_CONTROL (ib->scg->wbcg), sheet,
ib->is_col_header, element, step);
return TRUE;
}
......@@ -734,7 +736,7 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
GnumericSheet * const gsheet = GNUMERIC_SHEET (item_bar->scg->canvas);
gboolean const is_cols = item_bar->is_col_header;
double const zoom = sheet->last_zoom_factor_used;
int pos, start, element, x, y;
int pos, other_pos, start, element, x, y;
/* NOTE :
* No need to map coordinates since we do the zooming of the item bars manually
......@@ -830,12 +832,18 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
scg_mode_edit (item_bar->scg);
gnome_canvas_w2c (canvas, e->button.x, e->button.y, &x, &y);
pos = (is_cols) ? x : y;
if (is_cols) {
pos = x;
other_pos = y;
} else {
pos = y;
other_pos = x;
}
cri = is_pointer_on_division (item_bar, pos, &start, &element);
if (element < 0)
return FALSE;
if (pos < item_bar->indent)
return outline_button_press (item_bar, element, pos);
if (other_pos < item_bar->indent)
return outline_button_press (item_bar, element, other_pos);
if (e->button.button == 3) {
/* If the selection does not contain the current row/col
......
......@@ -215,6 +215,7 @@ gnumeric_main (void *closure, int argc, char *argv [])
gtk_main ();
}
plugins_shutdown ();
print_shutdown ();