diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/e-table/ChangeLog | 7 | ||||
-rw-r--r-- | widgets/e-table/e-table.c | 13 | ||||
-rw-r--r-- | widgets/table/e-table.c | 13 |
3 files changed, 33 insertions, 0 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 9fb45790dd..b6e01fb2cb 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,10 @@ +2000-04-15 Matt Loper <matt@helixcode.com> + + * e-table.c (et_xml_to_header): sanity-check our parameters. + (et_grouping_xml_to_sort_info): same. + (et_real_construct): Bail if we couldn't get the children we + wanted. + 2000-04-14 Christopher James Lahey <clahey@helixcode.com> * e-table-item.c, e-table-item.h: Added a row height cache. diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c index d6b594d12f..ee6014d728 100644 --- a/widgets/e-table/e-table.c +++ b/widgets/e-table/e-table.c @@ -706,6 +706,10 @@ et_xml_to_header (ETable *e_table, ETableHeader *full_header, xmlNode *xmlColumn ETableHeader *nh; xmlNode *column; const int max_cols = e_table_header_count (full_header); + + g_return_val_if_fail (e_table, NULL); + g_return_val_if_fail (full_header, NULL); + g_return_val_if_fail (xmlColumns, NULL); nh = e_table_header_new (); @@ -725,6 +729,10 @@ static void et_grouping_xml_to_sort_info (ETable *table, xmlNode *grouping) { int i; + + g_return_if_fail (table!=NULL); + g_return_if_fail (grouping!=NULL); + table->sort_info = e_table_sort_info_new (); gtk_object_ref (GTK_OBJECT (table->sort_info)); @@ -771,9 +779,14 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm, gtk_object_ref (GTK_OBJECT (etm)); xmlRoot = xmlDocGetRootElement (xmlSpec); + xmlColumns = e_xml_get_child_by_name (xmlRoot, "columns-shown"); xmlGrouping = e_xml_get_child_by_name (xmlRoot, "grouping"); + /* TODO: unref the etm and full_header, if these things fail? */ + g_return_if_fail (xmlColumns); + g_return_if_fail (xmlGrouping); + gtk_widget_push_visual (gdk_rgb_get_visual ()); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index d6b594d12f..ee6014d728 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -706,6 +706,10 @@ et_xml_to_header (ETable *e_table, ETableHeader *full_header, xmlNode *xmlColumn ETableHeader *nh; xmlNode *column; const int max_cols = e_table_header_count (full_header); + + g_return_val_if_fail (e_table, NULL); + g_return_val_if_fail (full_header, NULL); + g_return_val_if_fail (xmlColumns, NULL); nh = e_table_header_new (); @@ -725,6 +729,10 @@ static void et_grouping_xml_to_sort_info (ETable *table, xmlNode *grouping) { int i; + + g_return_if_fail (table!=NULL); + g_return_if_fail (grouping!=NULL); + table->sort_info = e_table_sort_info_new (); gtk_object_ref (GTK_OBJECT (table->sort_info)); @@ -771,9 +779,14 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm, gtk_object_ref (GTK_OBJECT (etm)); xmlRoot = xmlDocGetRootElement (xmlSpec); + xmlColumns = e_xml_get_child_by_name (xmlRoot, "columns-shown"); xmlGrouping = e_xml_get_child_by_name (xmlRoot, "grouping"); + /* TODO: unref the etm and full_header, if these things fail? */ + g_return_if_fail (xmlColumns); + g_return_if_fail (xmlGrouping); + gtk_widget_push_visual (gdk_rgb_get_visual ()); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); |