assorted bug fixes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@736 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-03-26 05:16:37 +00:00
parent 69e9877c9a
commit d1d574e8d9
3 changed files with 16 additions and 10 deletions

View File

@ -99,10 +99,13 @@ void destroyCombo (BasicCell *bcell)
box = (PopBox *) (cell->cell.gui_private);
moveCombo (bcell, -1, -1);
XtDestroyWidget (box->combobox);
free (box);
if (box) {
if (XtIsRealized(box->combobox)) {
moveCombo (bcell, -1, -1);
XtDestroyWidget (box->combobox);
}
free (box);
}
/* allow the widget to be created again */
cell->cell.gui_private = NULL;

View File

@ -307,6 +307,7 @@ void xaccInitBasicRegister (BasicRegister *reg, int type)
{
Table * table;
CellBlock *curs, *header;
int phys_r, phys_c;
reg->user_hook = NULL;
reg->destroy = NULL;
@ -374,8 +375,13 @@ void xaccInitBasicRegister (BasicRegister *reg, int type)
/* -------------------------------- */
table = xaccMallocTable ();
xaccSetTableSize (table, header->numRows, header->numCols, 1, 1);
phys_r = header->numRows + curs->numRows;
phys_c = header->numCols;
xaccSetTableSize (table, phys_r, phys_c, 2, 1);
xaccSetCursor (table, header, 0, 0, 0, 0);
xaccSetCursor (table, curs, header->numRows, 0, 1, 0);
xaccMoveCursor (table, header->numRows, 0);
reg->table = table;
}

View File

@ -555,13 +555,10 @@ xaccCreateTable (Table *table, Widget parent, char * name)
haveQuarks = True;
}
/* if a header exists, get alignments, widths from there */
/* The 0'th row of the handlers is defeined as the header */
alignments = NULL;
widths = NULL;
curs = table->current_cursor;
if (!curs) {
curs = table->handlers[0][0];
}
curs = table->handlers[0][0];
alignments = curs->alignments;
widths = curs->widths;
num_header_rows = curs->numRows;