/* If the widget is a buffer/gutter widget then we already have
the one we are looking for, so don't try and descend the widget
tree. */
- if (val->contents) {
+ if (val && val->contents) {
char *name = XtName(widget);
val = val->contents;
while (val) {
break;
val = val->next;
}
- if (!val)
- abort();
}
- user_data = val->call_data;
+ if (val)
+ user_data = val->call_data;
+ else
+ abort();
}
#endif
XtGetValues(shell, al, 1);
if (!kids || !*kids)
abort();
- widget = kids[0];
- if (!XtIsSubclass(widget, dialogWidgetClass))
- abort();
- id = lw_get_widget_id(widget);
- if (!id)
- abort();
-
- {
- widget_info *info = lw_get_widget_info(id);
- if (!info)
+ else {
+ widget = kids[0];
+ if (!XtIsSubclass(widget, dialogWidgetClass))
abort();
- if (info->selection_cb)
- info->selection_cb(widget, id, (XtPointer) - 1);
- }
+ id = lw_get_widget_id(widget);
+ if (!id)
+ abort();
+ else {
+ widget_info *info = lw_get_widget_info(id);
+ if (!info)
+ abort();
+ else if (info->selection_cb)
+ info->selection_cb(widget, id, (XtPointer) - 1);
+ }
- lw_destroy_all_widgets(id);
+ lw_destroy_all_widgets(id);
+ }
return NULL;
}
if (!node || !newtree)
abort();
+ else {
- copy = copy_widget_value_tree(newtree, STRUCTURAL_CHANGE);
+ copy = copy_widget_value_tree(newtree, STRUCTURAL_CHANGE);
- free_widget_value_contents(node);
- *node = *copy;
- free_widget_value(copy); /* free the node, but not its contents. */
+ free_widget_value_contents(node);
+ *node = *copy;
+ /* free the node, but not its contents. */
+ free_widget_value(copy);
+ }
return node;
}
if (!info)
abort();
-
- if (info->val)
+ else if (info->val)
return map_widget_values(info->val, mapfunc, closure);
return 0;
}