Commit 4aebffc4 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa
Browse files

Do not enable item editing if sheet is not in edit mode.

1999-01-17  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/gnumeric-sheet.c (gnumeric_sheet_can_move_cursor): Do not
	enable item editing if sheet is not in edit mode.
parent f6613daa
1999-01-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_can_move_cursor): Do not
enable item editing if sheet is not in edit mode.
1999-01-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet): Mark sheet
as being edited.
1999-01-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (dialog_query_load_file): Set the window modal.
......
1999-01-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_can_move_cursor): Do not
enable item editing if sheet is not in edit mode.
1999-01-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet): Mark sheet
as being edited.
1999-01-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (dialog_query_load_file): Set the window modal.
......
1999-01-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_can_move_cursor): Do not
enable item editing if sheet is not in edit mode.
1999-01-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet): Mark sheet
as being edited.
1999-01-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (dialog_query_load_file): Set the window modal.
......
1999-01-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_can_move_cursor): Do not
enable item editing if sheet is not in edit mode.
1999-01-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet): Mark sheet
as being edited.
1999-01-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/file.c (dialog_query_load_file): Set the window modal.
......
1999-01-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* ms-ole.c (ms_ole_destroy): Free f->header_root_list if set.
1999-01-03 Jeff Garzik <jgarzik@Pobox.com>
* ms-excel.c, ms-formula.c:
......
......@@ -1092,6 +1092,10 @@ find_workbook (MS_OLE * ptr)
*/
MS_OLE_DIRECTORY *d = ms_ole_directory_new (ptr);
/*
* We do not release the resources associated with d */
g_warning ("Leaking memory here");
/*
* The thing to seek; first the kingdom of God, then this:
*/
......
......@@ -1092,6 +1092,10 @@ find_workbook (MS_OLE * ptr)
*/
MS_OLE_DIRECTORY *d = ms_ole_directory_new (ptr);
/*
* We do not release the resources associated with d */
g_warning ("Leaking memory here");
/*
* The thing to seek; first the kingdom of God, then this:
*/
......
......@@ -370,7 +370,7 @@ ms_ole_create (const char *name)
return 0 ;
}
f = g_new (MS_OLE, 1) ;
f = g_new0 (MS_OLE, 1) ;
f->file_descriptor = file ;
fstat(file, &st) ;
f->length = st.st_size ;
......@@ -486,7 +486,7 @@ ms_ole_new (const char *name)
MS_OLE *f ;
printf ("New OLE file '%s'\n", name) ;
f = g_new (MS_OLE, 1) ;
f = g_new0 (MS_OLE, 1) ;
f->file_descriptor = file = open (name, O_RDWR) ;
if (file == -1 || fstat(file, &st))
......@@ -535,6 +535,10 @@ ms_ole_destroy (MS_OLE *f)
munmap (f->mem, f->length) ;
close (f->file_descriptor) ;
free (f) ;
if (f->header.root_list)
g_free (f->header.root_list);
printf ("Closing file\n") ;
}
else
......@@ -1146,7 +1150,7 @@ ms_ole_stream_open (MS_OLE_DIRECTORY *d, char mode)
if (!d || !f)
return 0 ;
s = g_new (MS_OLE_STREAM, 1) ;
s = g_new0 (MS_OLE_STREAM, 1) ;
s->file = f ;
s->pps = p ;
s->block = PPS_GET_STARTBLOCK(f,p) ;
......@@ -1222,7 +1226,7 @@ ms_ole_stream_close (MS_OLE_STREAM *s)
MS_OLE_DIRECTORY *
ms_ole_directory_new (MS_OLE *f)
{
MS_OLE_DIRECTORY *d = g_new (MS_OLE_DIRECTORY, 1) ;
MS_OLE_DIRECTORY *d = g_new0 (MS_OLE_DIRECTORY, 1) ;
d->file = f;
d->pps = PPS_ROOT_BLOCK ;
d->primary_entry = PPS_ROOT_BLOCK ;
......@@ -1374,7 +1378,7 @@ ms_ole_directory_create (MS_OLE_DIRECTORY *d, char *name, PPS_TYPE type)
PPS_IDX p = next_free_pps(d->file) ;
PPS_IDX prim ;
MS_OLE *f =d->file ;
MS_OLE_DIRECTORY *nd = g_new (MS_OLE_DIRECTORY, 1) ;
MS_OLE_DIRECTORY *nd = g_new0 (MS_OLE_DIRECTORY, 1) ;
SBPtr startblock ;
int lp=0 ;
......@@ -1436,7 +1440,7 @@ ms_biff_collate_block (BIFF_QUERY *bq)
{
if (!(bq->data = bq->pos->read_ptr(bq->pos, bq->length)))
{
bq->data = g_new (guint8, bq->length) ;
bq->data = g_new0 (guint8, bq->length) ;
bq->data_malloced = 1 ;
if (!bq->pos->read_copy(bq->pos, bq->data, bq->length))
return 0 ;
......@@ -1452,7 +1456,7 @@ ms_biff_query_new (MS_OLE_STREAM *ptr)
BIFF_QUERY *bq ;
if (!ptr)
return 0 ;
bq = g_new (BIFF_QUERY, 1) ;
bq = g_new0 (BIFF_QUERY, 1) ;
bq->opcode = 0 ;
bq->length =-4 ;
bq->data_malloced = 0 ;
......
......@@ -250,10 +250,12 @@ gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet)
g_return_val_if_fail (gsheet != NULL, FALSE);
g_return_val_if_fail (GNUMERIC_IS_SHEET (gsheet), FALSE);
if (!gsheet->sheet_view->sheet->editing)
return FALSE;
if (gsheet->item_editor)
if (gsheet->selecting_cell)
return TRUE;
if (gsheet->item_editor && gsheet->selecting_cell)
return TRUE;
entry = GTK_ENTRY (gsheet->entry);
cursor_pos = GTK_EDITABLE (entry)->current_pos;
......
......@@ -250,10 +250,12 @@ gnumeric_sheet_can_move_cursor (GnumericSheet *gsheet)
g_return_val_if_fail (gsheet != NULL, FALSE);
g_return_val_if_fail (GNUMERIC_IS_SHEET (gsheet), FALSE);
if (!gsheet->sheet_view->sheet->editing)
return FALSE;
if (gsheet->item_editor)
if (gsheet->selecting_cell)
return TRUE;
if (gsheet->item_editor && gsheet->selecting_cell)
return TRUE;
entry = GTK_ENTRY (gsheet->entry);
cursor_pos = GTK_EDITABLE (entry)->current_pos;
......
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