From 1864f2dfdf3e359f9cffaae332e2f22af9c15016 Mon Sep 17 00:00:00 2001 From: Kp Date: Mon, 12 Oct 2020 03:28:25 +0000 Subject: [PATCH] Remove unnecessary UI menu member `button` --- common/ui/menu.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/common/ui/menu.cpp b/common/ui/menu.cpp index e96be5e1f..02cdf3508 100644 --- a/common/ui/menu.cpp +++ b/common/ui/menu.cpp @@ -42,7 +42,6 @@ namespace { struct menu { std::unique_ptr[]> button_g; - std::unique_ptr button; int *choice; int num_buttons; }; @@ -79,17 +78,14 @@ int MenuX( int x, int y, int NumButtons, const char *const text[] ) auto m = std::make_unique(); m->num_buttons = NumButtons; m->button_g = std::make_unique[]>(NumButtons); - m->button = std::make_unique(NumButtons); m->choice = &choice; button_width = button_height = 0; for (int i=0; ibutton[i] = text[i]; - int width, height; - ui_get_button_size(*grd_curcanv->cv_font, m->button[i], width, height); + ui_get_button_size(*grd_curcanv->cv_font, text[i], width, height); if ( width > button_width ) button_width = width; if ( height > button_height ) button_height = height; @@ -135,7 +131,7 @@ int MenuX( int x, int y, int NumButtons, const char *const text[] ) for (int i=0; ibutton_g[i] = ui_add_gadget_button( dlg, x, y, button_width, button_height, m->button[i], NULL ); + m->button_g[i] = ui_add_gadget_button( dlg, x, y, button_width, button_height, text[i], NULL ); y += button_height+MENU_VERT_SPACING; }