changeset 23302:dcff2a4b6cb4

(single_submenu) [! HAVE_MULTILINGUAL_MENU]: Make strings unibyte. (xmenu_show) [! HAVE_MULTILINGUAL_MENU]: Likewise.
author Kenichi Handa <handa@m17n.org>
date Tue, 22 Sep 1998 10:33:09 +0000
parents 5f08a9f278b1
children fb38954a02d3
files src/xmenu.c
diffstat 1 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmenu.c	Tue Sep 22 10:23:40 1998 +0000
+++ b/src/xmenu.c	Tue Sep 22 10:33:09 1998 +0000
@@ -62,6 +62,7 @@
 #include "dispextern.h"
 
 #ifdef HAVE_X_WINDOWS
+#undef HAVE_MULTILINGUAL_MENU
 #ifdef USE_X_TOOLKIT
 #include <X11/Xlib.h>
 #include <X11/IntrinsicP.h>
@@ -1371,6 +1372,10 @@
 	  char *pane_string;
 	  pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
 	  prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
+#ifndef HAVE_MULTILINGUAL_MENU
+	  if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name))
+	    pane_name = string_make_unibyte (pane_name);
+#endif
 	  pane_string = (NILP (pane_name)
 			 ? "" : (char *) XSTRING (pane_name)->data);
 	  /* If there is just one top-level pane, put all its items directly
@@ -1409,7 +1414,12 @@
 	  descrip
 	    = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
 	  def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION];
-
+#ifndef HAVE_MULTILINGUAL_MENU
+	  if (STRING_MULTIBYTE (item_name))
+	    item_name = string_make_unibyte (item_name);
+	  if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
+	    descrip = string_make_unibyte (descrip);
+#endif
 	  wv = xmalloc_widget_value ();
 	  if (prev_wv) 
 	    prev_wv->next = wv;
@@ -1905,6 +1915,10 @@
 	  char *pane_string;
 	  pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
 	  prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
+#ifndef HAVE_MULTILINGUAL_MENU
+	  if (!NILP (pane_name) && STRING_MULTIBYTE (pane_name))
+	    pane_name = string_make_unibyte (pane_name);
+#endif
 	  pane_string = (NILP (pane_name)
 			 ? "" : (char *) XSTRING (pane_name)->data);
 	  /* If there is just one top-level pane, put all its items directly
@@ -1947,6 +1961,12 @@
 	  descrip
 	    = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
 	  def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION];
+#ifndef HAVE_MULTILINGUAL_MENU
+	  if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
+	    item_name = string_make_unibyte (item_name);
+	  if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
+	    item_name = string_make_unibyte (descrip);
+#endif
 
 	  wv = xmalloc_widget_value ();
 	  if (prev_wv) 
@@ -1982,6 +2002,10 @@
       wv_sep1->name = "--";
       wv_sep1->next = wv_sep2;
 
+#ifndef HAVE_MULTILINGUAL_MENU
+      if (STRING_MULTIBYTE (title))
+	title = string_make_unibyte (title);
+#endif
       wv_title->name = (char *) XSTRING (title)->data;
       wv_title->enabled = True;
       wv_title->next = wv_sep1;