From cef160d6302949c1e2fc7a86ef3482a2d5841ced Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 26 Dec 2005 22:28:38 +0100 Subject: [PATCH] No need to have link_form_menu() be a menu function when it has an action --- src/viewer/action.c | 2 +- src/viewer/text/form.c | 9 ++++----- src/viewer/text/form.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/viewer/action.c b/src/viewer/action.c index a022563e4..2f2c44681 100644 --- a/src/viewer/action.c +++ b/src/viewer/action.c @@ -289,7 +289,7 @@ do_action(struct session *ses, enum main_action action_id, int verbose) break; case ACT_MAIN_LINK_FORM_MENU: - link_form_menu(term, NULL, ses); + link_form_menu(ses); break; case ACT_MAIN_LUA_CONSOLE: diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index ff82e9457..48100c0e0 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -1640,16 +1640,15 @@ link_form_menu_func(struct terminal *term, void *link_number_, void *ses_) } void -link_form_menu(struct terminal *term, void *xxx, void *ses_) +link_form_menu(struct session *ses) { - struct session *ses = ses_; struct document_view *doc_view; struct link *link; struct menu_item *mi; struct form_control *fc; struct form *form; - assert(term && ses); + assert(ses); if_assert_failed return; doc_view = current_frame(ses); @@ -1699,7 +1698,7 @@ link_form_menu(struct terminal *term, void *xxx, void *ses_) continue; assert(text); - add_to_string(&str, _(text, term)); + add_to_string(&str, _(text, ses->tab->term)); rtext = fc->name; if (!rtext) rtext = fc->alt; @@ -1709,5 +1708,5 @@ link_form_menu(struct terminal *term, void *xxx, void *ses_) FREE_DATA); } - do_menu(term, mi, ses, 1); + do_menu(ses->tab->term, mi, ses, 1); } diff --git a/src/viewer/text/form.h b/src/viewer/text/form.h index f0ac45007..e71329ec5 100644 --- a/src/viewer/text/form.h +++ b/src/viewer/text/form.h @@ -92,6 +92,6 @@ void submit_given_form(struct session *ses, struct document_view *doc_view, stru void auto_submit_form(struct session *ses); void do_reset_form(struct document_view *doc_view, struct form *form); -void link_form_menu(struct terminal *term, void *xxx, void *ses_); +void link_form_menu(struct session *ses); #endif