Fix segfault and column size saving bugs.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2956 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-09-26 07:29:01 +00:00
parent bd9b63d5a9
commit dea20ba9f9
4 changed files with 11 additions and 7 deletions

View File

@ -719,7 +719,6 @@ gnucash_sheet_destroy (GtkObject *object)
for (i = GNUCASH_CURSOR_HEADER; i < GNUCASH_NUM_CURSORS; i++)
gnucash_sheet_style_destroy(sheet, sheet->cursor_styles[i]);
g_hash_table_destroy (sheet->layout_info_hash_table);
g_hash_table_destroy (sheet->dimensions_hash_table);
if (GTK_OBJECT_CLASS (sheet_parent_class)->destroy)
@ -2433,8 +2432,8 @@ gnucash_sheet_new (Table *table)
sheet->grid = item;
/* some register data */
sheet->layout_info_hash_table = g_hash_table_new (g_str_hash, g_str_equal);
sheet->dimensions_hash_table = g_hash_table_new (g_str_hash, g_str_equal);
sheet->dimensions_hash_table = g_hash_table_new (g_str_hash,
g_str_equal);
/* The cursor */
sheet->cursor = gnucash_cursor_new (sheet_group);

View File

@ -103,7 +103,6 @@ typedef struct {
SheetBlockStyle *cursor_styles[GNUCASH_NUM_CURSORS];
/* some style information associated to a sheet */
GHashTable *layout_info_hash_table;
GHashTable *dimensions_hash_table;
GTable *blocks;

View File

@ -895,8 +895,12 @@ gnucash_sheet_get_header_widths (GnucashSheet *sheet, int *header_widths)
cd = gnucash_style_get_cell_dimensions (style,
row, col);
if (cd == NULL)
continue;
cb_cell = gnc_cellblock_get_cell (header, row, col);
if (cb_cell == NULL)
continue;
if (cb_cell->cell_type < 0)
continue;

View File

@ -72,7 +72,8 @@ table_destroy_cb(Table *table)
for (i = 0; i < CELL_TYPE_COUNT; i++)
header_widths[i] = -1;
gnucash_sheet_get_header_widths (sheet, header_widths);
if (!GTK_OBJECT_DESTROYED(GTK_OBJECT(sheet)))
gnucash_sheet_get_header_widths (sheet, header_widths);
alist = SCM_EOL;
if (gnc_lookup_boolean_option("General", "Save Window Geometry", TRUE))
@ -91,7 +92,8 @@ table_destroy_cb(Table *table)
alist = gh_cons (assoc, alist);
}
gnc_set_option ("__gui", "reg_column_widths", alist);
if (!gh_null_p(alist))
gnc_set_option ("__gui", "reg_column_widths", alist);
gtk_widget_unref(GTK_WIDGET(sheet));
@ -148,7 +150,7 @@ gnc_table_init_gui (gncUIWidget widget, void *data)
while (gh_list_p(alist) && !gh_null_p(alist))
{
const char *name;
char *name;
CellType ctype;
SCM assoc;