summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Lees <adrian@aemulor.com>2005-07-16 16:17:49 +0000
committerAdrian Lees <adrian@aemulor.com>2005-07-16 16:17:49 +0000
commit23465f5705c031943510981eed6642811963c406 (patch)
tree53799baf2b2eea663a6b0b4cbc0d2d22b76abee9
parent77f1158f6b01aab282f76074e49f20c9ffbcced7 (diff)
downloadnetsurf-23465f5705c031943510981eed6642811963c406.tar.gz
netsurf-23465f5705c031943510981eed6642811963c406.tar.bz2
[project @ 2005-07-16 16:17:49 by adrianl]
Correct and simplify space -> hard space conversion svn path=/import/netsurf/; revision=1798
-rw-r--r--riscos/menus.c18
1 files 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,