From 23465f5705c031943510981eed6642811963c406 Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Sat, 16 Jul 2005 16:17:49 +0000 Subject: [project @ 2005-07-16 16:17:49 by adrianl] Correct and simplify space -> hard space conversion svn path=/import/netsurf/; revision=1798 --- riscos/menus.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/riscos/menus.c b/riscos/menus.c index c294b9869..64cc283a8 100644 --- a/riscos/menus.c +++ b/riscos/menus.c @@ -966,7 +966,7 @@ void ro_gui_menu_prepare_languages(bool accept, const char *lang) void gui_create_form_select_menu(struct browser_window *bw, struct form_control *control) { unsigned int i = 0, j; - char *text_convert, *temp, *s; + char *text_convert, *temp; struct form_option *option; wimp_pointer pointer; os_error *error; @@ -1039,6 +1039,12 @@ void gui_create_form_select_menu(struct browser_window *bw, wimp_ICON_FG_COLOUR_SHIFT) | (wimp_COLOUR_WHITE << wimp_ICON_BG_COLOUR_SHIFT); + + /* convert spaces to hard spaces to stop things + * like 'Go Home' being treated as if 'Home' is a + * keyboard shortcut and right aligned in the menu. + */ + temp = cnv_space2nbsp(option->text); if (!temp) { LOG(("cnv_space2nbsp failed")); @@ -1047,15 +1053,7 @@ void gui_create_form_select_menu(struct browser_window *bw, return; } - /* convert spaces to hard spaces to stop things - * like 'Go Home' being treated as if 'Home' is a - * keyboard shortcut and right aligned in the menu. - */ - for (s = temp; *s != '\0'; s++) - if (*s == 0x20) - *s = 0xa0; - - err = utf8_to_local_encoding(option->text, + err = utf8_to_local_encoding(temp, 0, &text_convert); if (err != UTF8_CONVERT_OK) { /* A bad encoding should never happen, -- cgit v1.2.3