Commit 7054f8de authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

control configuration of col and row headers seperately. support H or V


2002-10-13  Jody Goldberg <jody@gnome.org>

	* src/gnumeric-pane.c (gnm_pane_init) : control configuration of col
	  and row headers seperately.
	* src/sheet-control-gui.c (scg_resize) : support H or V only freezing.
	(scg_set_left_col) : test for freezing distinctly from the existence
	  of pane 3.
	(scg_set_top_row) : test for freezing distincly from the existence of
	  pane 1.
parent 4ccdc3eb
......@@ -18,7 +18,7 @@ Release Critical
1) graphs
2) stf
3) finish hlink dialog
4) finish support for h/v only splits
4) finish support for h/v only splits (DONE)
5) zip based format
5.1) move existing code into plugin
5.2) work on sax style exporter
......@@ -66,9 +66,9 @@ Misc stuff that should be fixed
-------------------------------
- Missing undo/redo for
- Freeze panes. (DONE)
- Duplicate sheet.
- Remove sheet. This raises some serious design issues.
- Freeze panes.
- Goal seek.
- Tabulate.
- Sheet object configuration changes.
......
2002-10-13 Jody Goldberg <jody@gnome.org>
* src/gnumeric-pane.c (gnm_pane_init) : control configuration of col
and row headers seperately.
* src/sheet-control-gui.c (scg_resize) : support H or V only freezing.
(scg_set_left_col) : test for freezing distinctly from the existence
of pane 3.
(scg_set_top_row) : test for freezing distincly from the existence of
pane 1.
2002-10-13 Jon K Hellan <hellan@acm.org>
* src/func.c (tokenized_help_new): Fix check for empty help string.
......
......@@ -42,6 +42,8 @@ Jody:
* Add AREAS so that we can finally finish off the lookup functions
* Clean up the function registration api
* Make format parsing utf8 clean
* Fix mishandling of empty strings in xls data validation importer
* Support Horizontal and Vertical only frozen panes
Morten:
* Port search center from gal's e-table to gtk's treeview.
......
2002-10-13 Jody Goldberg <jody@gnome.org>
* src/gnumeric-pane.c (gnm_pane_init) : control configuration of col
and row headers seperately.
* src/sheet-control-gui.c (scg_resize) : support H or V only freezing.
(scg_set_left_col) : test for freezing distinctly from the existence
of pane 3.
(scg_set_top_row) : test for freezing distincly from the existence of
pane 1.
2002-10-13 Jon K Hellan <hellan@acm.org>
* src/func.c (tokenized_help_new): Fix check for empty help string.
......
2002-10-13 Jody Goldberg <jody@gnome.org>
* src/gnumeric-pane.c (gnm_pane_init) : control configuration of col
and row headers seperately.
* src/sheet-control-gui.c (scg_resize) : support H or V only freezing.
(scg_set_left_col) : test for freezing distinctly from the existence
of pane 3.
(scg_set_top_row) : test for freezing distincly from the existence of
pane 1.
2002-10-13 Jon K Hellan <hellan@acm.org>
* src/func.c (tokenized_help_new): Fix check for empty help string.
......
2002-10-13 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_excel_read_pane) : the sizes are only valid if
there is a freeze in that direction.
* ms-excel-read.c (ms_excel_read_dv) : Fix handling of empty strings
and improve validation. NOTE : This is likely to come up again.
We need to know when there is always a 1 byte header, and when there
isn't in biff_get_text.
2002-10-09 Morten Welinder <welinder@rentec.com>
* ms-obj.h (struct _MSObj): Avoid "gboolean ... : 1".
......
......@@ -3454,7 +3454,14 @@ ms_excel_read_pane (BiffQuery *q, ExcelSheet *esheet, WorkbookView *wb_view)
CellPos frozen, unfrozen;
frozen = unfrozen = sv->initial_top_left;
unfrozen.col += x; unfrozen.row += y;
if (x > 0)
unfrozen.col += x;
else
colLeft = sv->initial_top_left.col;
if (y > 0)
unfrozen.row += y;
else
rwTop = sv->initial_top_left.row;
sv_freeze_panes (sv, &frozen, &unfrozen);
sv_set_initial_top_left (sv, colLeft, rwTop);
} else {
......@@ -3715,6 +3722,7 @@ ms_excel_read_dv (BiffQuery *q, ExcelSheet *esheet)
char *input_msg, *error_msg, *input_title, *error_title;
guint32 options, len;
guint8 const *data, *expr1_dat, *expr2_dat;
guint8 const *end = q->data + q->length;
int i;
Range r;
ValidationStyle style;
......@@ -3727,21 +3735,21 @@ ms_excel_read_dv (BiffQuery *q, ExcelSheet *esheet)
options = GSF_LE_GET_GUINT32 (q->data);
data = q->data + 4;
g_return_if_fail (data < (q->data + q->length));
g_return_if_fail (data+3 <= end);
input_title = biff_get_text (data + 2, GSF_LE_GET_GUINT8 (data), &len);
data += len + 2;
data += len + 2; if (len == 0) data++;
g_return_if_fail (data < (q->data + q->length));
g_return_if_fail (data+3 <= end);
error_title = biff_get_text (data + 2, GSF_LE_GET_GUINT8 (data), &len);
data += len + 2;
data += len + 2; if (len == 0) data++;
g_return_if_fail (data < (q->data + q->length));
g_return_if_fail (data+3 <= end);
input_msg = biff_get_text (data + 2, GSF_LE_GET_GUINT8 (data), &len);
data += len + 2;
data += len + 2; if (len == 0) data++;
g_return_if_fail (data < (q->data + q->length));
g_return_if_fail (data+3 <= end);
error_msg = biff_get_text (data + 2, GSF_LE_GET_GUINT8 (data), &len);
data += len + 2;
data += len + 2; if (len == 0) data++;
d (1, {
printf ("Input Title : '%s'\n", input_title);
......@@ -3750,21 +3758,22 @@ ms_excel_read_dv (BiffQuery *q, ExcelSheet *esheet)
printf ("Error Msg : '%s'\n", error_msg);
});
g_return_if_fail (data+2 <= end);
expr1_len = GSF_LE_GET_GUINT16 (data);
d (5, printf ("Unknown = %hu\n", GSF_LE_GET_GUINT16 (data+2)););
d (5, printf ("Unknown = %hx\n", GSF_LE_GET_GUINT16 (data+2)););
expr1_dat = data + 4; /* TODO : What are the missing 2 bytes ? */
data += expr1_len + 4;
g_return_if_fail (data < (q->data + q->length));
g_return_if_fail (data+2 <= end);
expr2_len = GSF_LE_GET_GUINT16 (data);
d (5, printf ("Unknown = %hu\n", GSF_LE_GET_GUINT16 (data+2)););
d (5, printf ("Unknown = %hx\n", GSF_LE_GET_GUINT16 (data+2)););
expr2_dat = data + 4; /* TODO : What are the missing 2 bytes ? */
data += expr2_len + 4;
g_return_if_fail (data < (q->data + q->length));
len = GSF_LE_GET_GUINT16 (data);
g_return_if_fail (data+2 < end);
i = GSF_LE_GET_GUINT16 (data);
for (data += 2; i-- > 0 ;) {
g_return_if_fail (data+8 <= end);
data = ms_excel_read_range (&r, data);
ranges = g_slist_prepend (ranges, range_dup (&r));
}
......@@ -3831,6 +3840,7 @@ ms_excel_read_dv (BiffQuery *q, ExcelSheet *esheet)
Range *r = ptr->data;
mstyle_ref (mstyle);
sheet_style_apply_range (esheet->gnum_sheet, r, mstyle);
d (1, range_dump (r, "\n"););
g_free (r);
}
g_slist_free (ranges);
......
......@@ -70,7 +70,6 @@ cell_cleanout (Cell *cell)
dependent_unlink (CELL_TO_DEP (cell), &cell->pos);
gnm_expr_unref (cell->base.expression);
cell->base.expression = NULL;
cell->base.flags &= ~(CELL_HAS_EXPRESSION);
}
if (cell->value) {
......@@ -304,7 +303,6 @@ cell_set_expr_and_value (Cell *cell, GnmExpr const *expr, Value *v,
cell_dirty (cell);
cell->base.expression = expr;
cell->base.flags |= CELL_HAS_EXPRESSION;
cell->value = v;
if (link_expr)
dependent_link (CELL_TO_DEP (cell), &cell->pos);
......@@ -330,7 +328,6 @@ cell_set_expr_internal (Cell *cell, GnmExpr const *expr)
cell_cleanout (cell);
cell->base.expression = expr;
cell->base.flags |= CELL_HAS_EXPRESSION;
/* Until the value is recomputed, we put in this value. */
cell->value = value_new_empty ();
......@@ -616,7 +613,6 @@ cell_convert_expr_to_value (Cell *cell)
gnm_expr_unref (cell->base.expression);
cell->base.expression = NULL;
cell->base.flags &= ~CELL_HAS_EXPRESSION;
if (cell->rendered_value == NULL)
cell_render_value (cell, TRUE);
......
......@@ -5,15 +5,11 @@
#include "dependent.h"
typedef enum {
/* MUST BE > 0xFFFFFFF for Dependent */
/* Cell has an expression (Can we use base.expr == NULL ?)*/
CELL_HAS_EXPRESSION = 0x10000000,
/* MUST BE > 0xFFF,FFFF to avoid conflict with Dependent */
/* Cell is linked into the sheet */
CELL_IN_SHEET_LIST = 0x20000000,
CELL_IN_SHEET_LIST = 0x10000000,
/* Is the top left corner of a merged region */
CELL_IS_MERGED = 0x40000000,
/* Cell content spans */
CELL_CONTENT_SPANS = 0x80000000
CELL_IS_MERGED = 0x20000000,
} CellFlags;
/* Definition of a Gnumeric Cell */
......@@ -43,7 +39,7 @@ void cell_relocate (Cell *cell, GnmExprRewriteInfo const *rwinfo);
*/
#define cell_needs_recalc(cell) ((cell)->base.flags & DEPENDENT_NEEDS_RECALC)
#define cell_expr_is_linked(cell) ((cell)->base.flags & DEPENDENT_IS_LINKED)
#define cell_has_expr(cell) ((cell)->base.flags & CELL_HAS_EXPRESSION)
#define cell_has_expr(cell) ((cell)->base.expression != NULL)
#define cell_is_linked(cell) ((cell)->base.flags & CELL_IN_SHEET_LIST)
#define cell_is_merged(cell) ((cell)->base.flags & CELL_IS_MERGED)
CellComment *cell_has_comment_pos (const Sheet *sheet, const CellPos *pos);
......
......@@ -5373,3 +5373,86 @@ cmd_define_name (WorkbookControl *wbc, char const *name, ParsePos const *pp,
return command_push_undo (wbc, obj);
}
/******************************************************************/
#if 0
#define CMD_FREEZE_PANES_TYPE (cmd_freeze_panes_get_type ())
#define CMD_FREEZE_PANES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CMD_FREEZE_PANES_TYPE, CmdFreezePanes))
typedef struct
{
GnumericCommand cmd;
SheetView *sv;
CellPos pos;
} CmdFreezePanes;
GNUMERIC_MAKE_COMMAND (CmdFreezePanes, cmd_freeze_panes);
static gboolean
cmd_freeze_panes_undo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdFreezePanes *me = CMD_FREEZE_PANES (cmd);
return FALSE;
}
static gboolean
cmd_freeze_panes_redo (GnumericCommand *cmd, WorkbookControl *wbc)
{
CmdFreezePanes *me = CMD_FREEZE_PANES (cmd);
return FALSE;
}
static void
cmd_freeze_panes_finalize (GObject *cmd)
{
CmdFreezePanes *me = CMD_FREEZE_PANES (cmd);
gnumeric_command_finalize (cmd);
}
/**
* cmd_freeze_panes :
* @wbc : where to report errors
* @sv : the view to freeze
* @frozen :
* @unfrozen :
*
* Returns TRUE on error
**/
gboolean
cmd_freeze_panes (WorkbookControl *wbc, SheetView *sv,
CellPos const *frozen, CellPos const *unfrozen)
{
GObject *obj;
CmdFreezePanes *me;
g_return_val_if_fail (name != NULL, TRUE);
g_return_val_if_fail (pp != NULL, TRUE);
g_return_val_if_fail (expr != NULL, TRUE);
obj = g_object_new (CMD_FREEZE_PANES_TYPE, NULL);
me = CMD_FREEZE_PANES (obj);
me->sv = sv;
me->frozen = f;
me->unfrozen = expr;
me->nexpr = nexpr;
me->create_name = nexpr == NULL;
if (nexpr != NULL)
expr_name_ref (me->nexpr);
me->cmd.sheet = wb_control_cur_sheet (wbc);
me->cmd.size = 1;
if (me->create_name)
me->cmd.cmd_descriptor =
g_strdup_printf (_("Define Name %s"), name);
else
me->cmd.cmd_descriptor =
g_strdup_printf (_("Update Name %s"), name);
return command_push_undo (wbc, obj);
}
#endif
......@@ -86,7 +86,7 @@ gnumeric_pane_header_init (GnumericPane *pane, SheetControlGUI *scg,
void
gnm_pane_init (GnumericPane *pane, SheetControlGUI *scg,
gboolean headers, int index)
gboolean col_headers, gboolean row_headers, int index)
{
GnomeCanvasItem *item;
GnomeCanvasGroup *gcanvas_group;
......@@ -119,11 +119,15 @@ gnm_pane_init (GnumericPane *pane, SheetControlGUI *scg,
pane->cursor.special = NULL;
pane->anted_cursors = NULL;
if (headers) {
if (col_headers)
gnumeric_pane_header_init (pane, scg, TRUE);
else
pane->col.canvas = NULL;
if (row_headers)
gnumeric_pane_header_init (pane, scg, FALSE);
} else
pane->col.canvas = pane->row.canvas = NULL;
else
pane->row.canvas = NULL;
pane->drag_object = NULL;
i = sizeof (pane->control_points)/sizeof(GnomeCanvasItem *);
......
......@@ -36,7 +36,7 @@ struct _GnumericPane {
};
void gnm_pane_init (GnumericPane *pane, SheetControlGUI *scg,
gboolean headers, int index);
gboolean col_header, gboolean row_header, int index);
void gnm_pane_release (GnumericPane *pane);
void gnm_pane_bound_set (GnumericPane *pane,
int start_col, int start_row,
......
......@@ -277,37 +277,45 @@ scg_resize (SheetControl *sc, gboolean force_scroll)
/* pane 0 has already been done */
for (i = scg->active_panes; i-- > 1 ; ) {
GnumericPane const *p = scg->pane + i;
p->gcanvas->first_offset.col = scg_colrow_distance_get (
scg, TRUE, 0, p->gcanvas->first.col);
p->gcanvas->first_offset.row = scg_colrow_distance_get (
scg, FALSE, 0, p->gcanvas->first.row);
if (p->is_active) {
p->gcanvas->first_offset.col = scg_colrow_distance_get (
scg, TRUE, 0, p->gcanvas->first.col);
p->gcanvas->first_offset.row = scg_colrow_distance_get (
scg, FALSE, 0, p->gcanvas->first.row);
}
}
gtk_widget_set_usize (GTK_WIDGET (scg->pane[1].gcanvas), r - l, -1);
gtk_widget_set_usize (GTK_WIDGET (scg->pane[2].gcanvas), r - l, b - t);
gtk_widget_set_usize (GTK_WIDGET (scg->pane[3].gcanvas), -1, b - t);
if (scg->pane[1].is_active) {
gtk_widget_set_usize (GTK_WIDGET (scg->pane[1].gcanvas), r - l, -1);
/* The item_bar_calcs should be equal */
/* FIXME : The canvas gets confused when the initial scroll
* region is set too early in its life cycle.
* It likes it to be at the origin, we can live with that for now.
* However, we really should track the bug eventually.
*/
h = item_bar_calc_size (scg->pane[1].col.item);
gtk_widget_set_usize (GTK_WIDGET (scg->pane[1].col.canvas), r - l, h+1);
gnome_canvas_set_scroll_region (scg->pane[1].col.canvas,
0, 0, GNUMERIC_CANVAS_FACTOR_X / zoom, h / zoom);
/* l / zoom, 0, r / zoom, h / zoom); */
}
if (scg->pane[3].is_active) {
gtk_widget_set_usize (GTK_WIDGET (scg->pane[3].gcanvas), -1, b - t);
/* The item_bar_calcs should be equal */
w = item_bar_calc_size (scg->pane[3].row.item);
gtk_widget_set_usize (GTK_WIDGET (scg->pane[3].row.canvas), w+1, b - t);
gnome_canvas_set_scroll_region (scg->pane[3].row.canvas,
0, 0, w / zoom, GNUMERIC_CANVAS_FACTOR_Y / zoom);
/* 0, t / zoom, w / zoom, b / zoom); */
}
if (scg->pane[2].is_active)
gtk_widget_set_usize (GTK_WIDGET (scg->pane[2].gcanvas), r - l, b - t);
/* The item_bar_calcs should be equal */
/* FIXME : The canvas gets confused when the initial scroll
* region is set too early in its life cycle.
* It likes it to be at the origin, we can live with that for now.
* However, we really should track the bug eventually.
*/
h = item_bar_calc_size (scg->pane[2].col.item);
gtk_widget_set_usize (GTK_WIDGET (scg->pane[2].col.canvas), r - l, h+1);
gnome_canvas_set_scroll_region (scg->pane[2].col.canvas,
0, 0, GNUMERIC_CANVAS_FACTOR_X / zoom, h / zoom);
/* l / zoom, 0, r / zoom, h / zoom); */
gnome_canvas_set_scroll_region (scg->pane[0].col.canvas,
0, 0, GNUMERIC_CANVAS_FACTOR_X / zoom, h / zoom);
/* r / zoom, 0, GNUMERIC_CANVAS_FACTOR_X / zoom, h / zoom); */
/* The item_bar_calcs should be equal */
w = item_bar_calc_size (scg->pane[2].row.item);
gtk_widget_set_usize (GTK_WIDGET (scg->pane[2].row.canvas), w+1, b - t);
gnome_canvas_set_scroll_region (scg->pane[2].row.canvas,
0, 0, w / zoom, GNUMERIC_CANVAS_FACTOR_Y / zoom);
/* 0, t / zoom, w / zoom, b / zoom); */
gnome_canvas_set_scroll_region (scg->pane[0].row.canvas,
0, 0, w / zoom, GNUMERIC_CANVAS_FACTOR_Y / zoom);
/* 0, b / zoom, w / zoom, GNUMERIC_CANVAS_FACTOR_Y / zoom); */
......@@ -626,8 +634,7 @@ gnm_canvas_update_inital_top_left (GnmCanvas const *gcanvas)
{
if (gcanvas->pane->index == 0) {
SheetView *sv = gcanvas->simple.scg->sheet_control.view;
sv->initial_top_left.col = gcanvas->first.col;
sv->initial_top_left.row = gcanvas->first.row;
sv->initial_top_left = gcanvas->first;
}
}
......@@ -681,11 +688,12 @@ scg_set_left_col (SheetControlGUI *scg, int col)
else if (col > bound->end.col)
col = bound->end.col;
if (scg->pane[3].is_active) {
if (scg->pane[1].is_active) {
int right = scg->sheet_control.view->unfrozen_top_left.col;
if (col < right)
col = right;
gnm_canvas_set_left_col (scg_pane (scg, 3), col);
if (scg->pane[3].is_active)
gnm_canvas_set_left_col (scg_pane (scg, 3), col);
}
gnm_canvas_set_left_col (scg_pane (scg, 0), col);
}
......@@ -740,11 +748,12 @@ scg_set_top_row (SheetControlGUI *scg, int row)
else if (row > bound->end.row)
row = bound->end.row;
if (scg->pane[1].is_active) {
if (scg->pane[3].is_active) {
int bottom = scg->sheet_control.view->unfrozen_top_left.row;
if (row < bottom)
row = bottom;
gnm_canvas_set_top_row (scg_pane (scg, 1), row);
if (scg->pane[1].is_active)
gnm_canvas_set_top_row (scg_pane (scg, 1), row);
}
gnm_canvas_set_top_row (scg_pane (scg, 0), row);
}
......@@ -900,7 +909,7 @@ scg_make_cell_visible (SheetControlGUI *scg, int col, int row,
couple_panes ? br->col : scg->pane[0].gcanvas->first.col,
scg->pane[1].gcanvas->first.row,
force_scroll);
if (couple_panes)
if (couple_panes && scg->pane[3].is_active)
gnm_canvas_set_left_col (scg->pane[3].gcanvas, br->col);
} else if (couple_panes) { /* pane 2 */
/* FIXME : We may need to change the way this routine
......@@ -927,7 +936,7 @@ scg_make_cell_visible (SheetControlGUI *scg, int col, int row,
? br->row
: scg->pane[0].gcanvas->first.row,
force_scroll);
if (couple_panes)
if (couple_panes && scg->pane[1].is_active)
gnm_canvas_set_top_row (scg->pane[1].gcanvas,
br->row);
} else { /* pane 0 */
......@@ -970,14 +979,16 @@ scg_set_panes (SheetControl *sc)
if (being_frozen) {
CellPos const *tl = &sc->view->frozen_top_left;
CellPos const *br = &sc->view->unfrozen_top_left;
gboolean const freeze_h = br->col > tl->col;
gboolean const freeze_v = br->row > tl->row;
gnm_pane_bound_set (scg->pane + 0,
br->col, br->row,
SHEET_MAX_COLS-1, SHEET_MAX_ROWS-1);
if (br->col > tl->col) {
scg->active_panes++;
gnm_pane_init (scg->pane + 1, scg, FALSE, 1);
if (freeze_h) {
scg->active_panes = 2;
gnm_pane_init (scg->pane + 1, scg, TRUE, FALSE, 1);
gnm_pane_bound_set (scg->pane + 1,
tl->col, br->row, br->col-1, SHEET_MAX_ROWS-1);
gtk_table_attach (scg->inner_table,
......@@ -986,24 +997,18 @@ scg_set_panes (SheetControl *sc)
GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
}
if (br->col > tl->col && br->row > tl->row) {
scg->active_panes++;
gnm_pane_init (scg->pane + 2, scg, TRUE, 2);
gnm_pane_bound_set (scg->pane + 2,
tl->col, tl->row, br->col-1, br->row-1);
gtk_table_attach (scg->inner_table,
GTK_WIDGET (scg->pane[2].col.canvas),
GTK_WIDGET (scg->pane[1].col.canvas),
1, 2, 0, 1,
GTK_FILL | GTK_SHRINK,
GTK_FILL,
0, 0);
gtk_table_attach (scg->inner_table,
GTK_WIDGET (scg->pane[2].row.canvas),
0, 1, 1, 2,
GTK_FILL | GTK_SHRINK,
GTK_FILL,
0, 0);
}
if (freeze_h && freeze_v) {
scg->active_panes = 4;
gnm_pane_init (scg->pane + 2, scg, FALSE, FALSE, 2);
gnm_pane_bound_set (scg->pane + 2,
tl->col, tl->row, br->col-1, br->row-1);
gtk_table_attach (scg->inner_table,
GTK_WIDGET (scg->pane[2].gcanvas),
1, 2, 1, 2,
......@@ -1011,9 +1016,9 @@ scg_set_panes (SheetControl *sc)
GTK_FILL,
0, 0);
}
if (br->row > tl->row) {
scg->active_panes++;
gnm_pane_init (scg->pane + 3, scg, FALSE, 3);
if (freeze_v) {
scg->active_panes = 4;
gnm_pane_init (scg->pane + 3, scg, FALSE, TRUE, 3);
gnm_pane_bound_set (scg->pane + 3,
br->col, tl->row, SHEET_MAX_COLS-1, br->row-1);
gtk_table_attach (scg->inner_table,
......@@ -1022,6 +1027,12 @@ scg_set_panes (SheetControl *sc)
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_FILL | GTK_SHRINK,
0, 0);
gtk_table_attach (scg->inner_table,
GTK_WIDGET (scg->pane[3].row.canvas),
0, 1, 1, 2,
GTK_FILL | GTK_SHRINK,
GTK_FILL,
0, 0);
}
} else {
if (scg->pane[1].is_active)
......@@ -1096,7 +1107,7 @@ sheet_control_gui_new (SheetView *sv)
0,
0, 0);
gnm_pane_init (scg->pane + 0, scg, TRUE, 0);
gnm_pane_init (scg->pane + 0, scg, TRUE, TRUE, 0);
scg->inner_table = GTK_TABLE (gtk_table_new (3, 3, FALSE));
gtk_table_attach (scg->inner_table, GTK_WIDGET (scg->corner),
0, 1, 0, 1,
......
......@@ -617,13 +617,12 @@ sv_freeze_panes (SheetView *sv,
if (frozen != NULL) {
g_return_if_fail (unfrozen != NULL);
g_return_if_fail (unfrozen->col > frozen->col);
g_return_if_fail (unfrozen->row > frozen->row);
g_return_if_fail (unfrozen->col >= frozen->col);
g_return_if_fail (unfrozen->row >= frozen->row);
/* Just in case */
if (unfrozen->col != (SHEET_MAX_COLS-1) &&
unfrozen->row != (SHEET_MAX_ROWS-1)) {
g_return_if_fail (unfrozen->row > frozen->row);
sv->frozen_top_left = *frozen;
sv->unfrozen_top_left = *unfrozen;
} else
......@@ -687,4 +686,5 @@ sv_set_initial_top_left (SheetView *sv, int col, int row)
sv->initial_top_left.col = col;
sv->initial_top_left.row = row;
printf ("initial = %s\n", cellpos_as_string (&sv->initial_top_left));
}
......@@ -2304,16 +2304,25 @@ cb_view_freeze_panes (GtkWidget *widget, WorkbookControlGUI *wbcg)
frozen_tl = gcanvas->first;
unfrozen_tl = sv->edit_pos;
if (unfrozen_tl.col <= gcanvas->first.col ||
if (unfrozen_tl.col == gcanvas->first.col) {
if (unfrozen_tl.row == gcanvas->first.row)
unfrozen_tl.col = unfrozen_tl.row = -1;
else
unfrozen_tl.col = frozen_tl.col = 0;
} else if (unfrozen_tl.row == gcanvas->first.row)
unfrozen_tl.row = frozen_tl.row = 0;
if (unfrozen_tl.col < gcanvas->first.col ||
unfrozen_tl.col > gcanvas->last_full.col)
unfrozen_tl.col = (gcanvas->first.col + gcanvas->last_full.col) / 2;
if (unfrozen_tl.row <= gcanvas->first.row ||
if (unfrozen_tl.row < gcanvas->first.row ||
unfrozen_tl.row > gcanvas->last_full.row)
unfrozen_tl.row = (gcanvas->first.row + gcanvas->last_full.row) / 2;
if (unfrozen_tl.col > frozen_tl.col &&
unfrozen_tl.row > frozen_tl.row)
sv_freeze_panes (sv, &frozen_tl, &unfrozen_tl);
g_return_if_fail (unfrozen_tl.col > frozen_tl.col ||
unfrozen_tl.row > frozen_tl.row);
sv_freeze_panes (sv, &frozen_tl, &unfrozen_tl);
} else
sv_freeze_panes (sv, NULL, NULL);
}
......
......@@ -2771,10 +2771,8 @@ xml_read_cell_copy (XmlParseContext *ctxt, xmlNodePtr tree,
if (val != NULL) { /* String was a value */
value_release (cell->value);
cell->value = val;
} else { /* String was an expression */
} else /* String was an expression */
cell->base.expression = expr;
cell->base.flags |= CELL_HAS_EXPRESSION;
}
}
if (shared_expr_index > 0) {
......@@ -2789,7 +2787,6 @@ xml_read_cell_copy (XmlParseContext *ctxt, xmlNodePtr tree,
cell->base.expression = gnm_expr_new_constant (
value_new_string (
gnm_expr_char_start_p ((char const *)content)));
cell->base.flags |= CELL_HAS_EXPRESSION;
value_release (cell->value);
cell->value = value_new_empty ();
}
......@@ -2807,7 +2804,6 @@ xml_read_cell_copy (XmlParseContext *ctxt, xmlNodePtr tree,
shared_expr_index - 1);
gnm_expr_ref (expr);
cell->base.expression = expr;
cell->base.flags |= CELL_HAS_EXPRESSION;
} else {
g_warning ("XML-IO: Missing shared expression");
}
......
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