diff options
Diffstat (limited to 'Build/source/texk/xdvik/gui')
-rw-r--r-- | Build/source/texk/xdvik/gui/menu.c | 8 | ||||
-rw-r--r-- | Build/source/texk/xdvik/gui/xm_toolbar.c | 14 |
2 files changed, 13 insertions, 9 deletions
diff --git a/Build/source/texk/xdvik/gui/menu.c b/Build/source/texk/xdvik/gui/menu.c index b78210d7658..6e305f2e8b4 100644 --- a/Build/source/texk/xdvik/gui/menu.c +++ b/Build/source/texk/xdvik/gui/menu.c @@ -71,10 +71,11 @@ set_menu_info(void *val, XtActionProc proc, Boolean (*cmp)(), struct button_info && item->elems[i].action != NULL && item->elems[i].action->proc != NULL && item->elems[i].action->proc == proc - && item->elems[i].action->param != NULL) { + && item->elems[i].action->num_params > 0 + && item->elems[i].action->params[0] != NULL) { Boolean state; ASSERT(cmp != NULL, "comparison function musn't be NULL!"); - state = cmp(val, item->elems[i].action->param); + state = cmp(val, item->elems[i].action->params[0]); #ifdef MOTIF ASSERT(item->elems[i].widget != 0, "Widget musn't be NULL!"); XmToggleButtonSetState(item->elems[i].widget, state, False); @@ -231,8 +232,7 @@ insert_items(struct button_info **info, char **items, size_t num_items, have_error = True; } - if (strlen(action) == 0 - || (my_action = compile_action(action)) == NULL) { + if (strlen(action) == 0 || (!compile_action(action, &my_action))) { XDVI_WARNING((stderr, "Invalid action \"%s\" for button \"%s\" (skipping this line).", action, items[0])); have_error = True; diff --git a/Build/source/texk/xdvik/gui/xm_toolbar.c b/Build/source/texk/xdvik/gui/xm_toolbar.c index 4984862db57..f68e376e966 100644 --- a/Build/source/texk/xdvik/gui/xm_toolbar.c +++ b/Build/source/texk/xdvik/gui/xm_toolbar.c @@ -649,10 +649,12 @@ enter_leave(Widget w, XtPointer closure, XEvent *event, Boolean *cont) static void button_info_save(struct xdvi_action *action, Widget w) { - if (action->proc == Act_back_page && strcmp(action->param, "1") == 0) { + if (action->proc == Act_back_page + && action->num_params > 0 && strcmp(action->params[0], "1") == 0) { m_button_info.back_button = w; } - else if (action->proc == Act_forward_page && strcmp(action->param, "1") == 0) { + else if (action->proc == Act_forward_page + && action->num_params > 0 && strcmp(action->params[0], "1") == 0) { m_button_info.forward_button = w; } else if (action->proc == Act_pagehistory_back) { @@ -663,7 +665,8 @@ button_info_save(struct xdvi_action *action, Widget w) set_button_sensitivity(w, False); m_button_info.hyperref_forward_button = w; } - else if (action->proc == Act_set_shrink_factor && action->param[0] == '+') { + else if (action->proc == Act_set_shrink_factor + && action->num_params > 0 && action->params[0][0] == '+') { m_button_info.zoom_in_button = w; } } @@ -748,10 +751,11 @@ create_toolbar(Widget parent, Widget menu_bar) } else if (item_count == 4) { Pixmap sens, insens; - sens = insens = 0; /* make compiler happy ... */ int idx = strtoul(line_items[0], (char **)NULL, 10); struct xdvi_action *action; + sens = insens = 0; /* make compiler happy ... */ + TRACE_GUI((stderr, "creating pixmap at %d", idx)); if (!create_pixmap(tool_bar, idx, &sens, &insens)) { free(toolbar_buttons); @@ -766,7 +770,7 @@ create_toolbar(Widget parent, Widget menu_bar) } toolbar_buttons[n].type = TB_BUTTON; - if ((action = compile_action(line_items[3])) != NULL) { + if (compile_action(line_items[3], &action)) { char *long_tooltip = xstrdup(line_items[1]); toolbar_buttons[n].tip = xstrdup(line_items[2]); /* char *short_tooltip = xstrdup(line_items[2]); */ |