From 86ec8d221e158ff53f47766464ddb1c5baff5167 Mon Sep 17 00:00:00 2001 From: Yuedong Du Date: Tue, 2 Dec 2003 05:27:11 +0000 Subject: don't assert row=0 as fault, it cause bug 51199. 2003-12-01 Yuedong Du * gal/a11y/e-table/gal-a11y-e-table-item.c: (gal_a11y_e_table_item_new): don't assert row=0 as fault, it cause bug 51199. svn path=/trunk/; revision=23566 --- a11y/e-table/gal-a11y-e-table-item.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/a11y/e-table/gal-a11y-e-table-item.c b/a11y/e-table/gal-a11y-e-table-item.c index 4884a95ba6..fadcb296ac 100644 --- a/a11y/e-table/gal-a11y-e-table-item.c +++ b/a11y/e-table/gal-a11y-e-table-item.c @@ -1011,16 +1011,19 @@ gal_a11y_e_table_item_new (AtkObject *parent, GET_PRIVATE (a11y)->parent = parent; GET_PRIVATE (a11y)->index_in_parent = index_in_parent; - g_return_val_if_fail (item->cols > 0 && item->rows > 0, NULL); + g_return_val_if_fail (item->cols >= 0 && item->rows >= 0, NULL); /* Initialize cell data. */ n = item->cols * item->rows; GET_PRIVATE (a11y)->cols = item->cols; GET_PRIVATE (a11y)->rows = item->rows; - GET_PRIVATE (a11y)->cell_data = g_malloc0(n*sizeof(gpointer)); - - /* memory error. */ - if ( GET_PRIVATE (a11y) == NULL) - return NULL; + if (n > 0) { + GET_PRIVATE (a11y)->cell_data = g_malloc0(n*sizeof(gpointer)); + /* memory error. */ + if ( GET_PRIVATE (a11y)->cell_data == NULL) + return NULL; + } else + GET_PRIVATE (a11y)->cell_data = NULL; + GET_PRIVATE (a11y)->columns = e_table_header_get_columns (item->header); if ( GET_PRIVATE (a11y)->columns == NULL) -- cgit v1.2.3