diff options
author | Yuedong Du <yuedong.du@sun.com> | 2003-12-02 13:27:11 +0800 |
---|---|---|
committer | Yuedong Du <york@src.gnome.org> | 2003-12-02 13:27:11 +0800 |
commit | 86ec8d221e158ff53f47766464ddb1c5baff5167 (patch) | |
tree | 3ab2d0cf603cd91acb29c1227c55188b5ab9f5cc | |
parent | 49e7dd311ec4652cbd87fe6f7627c54ab20f4782 (diff) | |
download | gsoc2013-evolution-86ec8d221e158ff53f47766464ddb1c5baff5167.tar.gz gsoc2013-evolution-86ec8d221e158ff53f47766464ddb1c5baff5167.tar.zst gsoc2013-evolution-86ec8d221e158ff53f47766464ddb1c5baff5167.zip |
don't assert row=0 as fault, it cause bug 51199.
2003-12-01 Yuedong Du <yuedong.du@sun.com>
* 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
-rw-r--r-- | a11y/e-table/gal-a11y-e-table-item.c | 15 |
1 files 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) |