aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-09-30 15:36:49 +0800
committerPo Lu2023-09-30 15:40:21 +0800
commitcdc653d68f44a253a7a06f7eed981a7fd1c7e785 (patch)
tree5a1d00de0651ab5b6ce0faa47da67f27c647800b /src
parent9a3523e7d839fd45180e553c10d2f22475fa30c7 (diff)
downloademacs-cdc653d68f44a253a7a06f7eed981a7fd1c7e785.tar.gz
emacs-cdc653d68f44a253a7a06f7eed981a7fd1c7e785.zip
Update Android port
* src/androidmenu.c (android_menu_show): Properly encode pane names before deriving Java strings from them. * src/sfntfont.c (sfnt_parse_style, sfntfont_list_1): Intern adstyles.
Diffstat (limited to 'src')
-rw-r--r--src/androidmenu.c19
-rw-r--r--src/sfntfont.c7
2 files changed, 19 insertions, 7 deletions
diff --git a/src/androidmenu.c b/src/androidmenu.c
index 3b34f032c35..ed26bdafa85 100644
--- a/src/androidmenu.c
+++ b/src/androidmenu.c
@@ -248,7 +248,6 @@ android_menu_show (struct frame *f, int x, int y, int menuflags,
248 jobject title_string, help_string, temp; 248 jobject title_string, help_string, temp;
249 size_t i; 249 size_t i;
250 Lisp_Object pane_name, prefix; 250 Lisp_Object pane_name, prefix;
251 const char *pane_string;
252 specpdl_ref count, count1; 251 specpdl_ref count, count1;
253 Lisp_Object item_name, enable, def, tem, entry, type, selected; 252 Lisp_Object item_name, enable, def, tem, entry, type, selected;
254 Lisp_Object help; 253 Lisp_Object help;
@@ -357,13 +356,21 @@ android_menu_show (struct frame *f, int x, int y, int menuflags,
357 /* Now figure out the title of this pane. */ 356 /* Now figure out the title of this pane. */
358 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); 357 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
359 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); 358 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
360 pane_string = (NILP (pane_name) 359
361 ? "" : SSDATA (pane_name)); 360 /* PANE_NAME may be nil, in which case it must be set to an
362 if ((menuflags & MENU_KEYMAPS) && !NILP (prefix)) 361 empty string. */
363 pane_string++; 362
363 if (NILP (pane_name))
364 pane_name = empty_unibyte_string;
365
366 /* Remove the leading prefix character if need be. */
367
368 if ((menuflags & MENU_KEYMAPS) && !NILP (prefix)
369 && SCHARS (prefix))
370 pane_name = Fsubstring (pane_name, make_fixnum (1), Qnil);
364 371
365 /* Add the pane. */ 372 /* Add the pane. */
366 temp = (*env)->NewStringUTF (env, pane_string); 373 temp = android_build_string (pane_name);
367 android_exception_check (); 374 android_exception_check ();
368 375
369 (*env)->CallNonvirtualVoidMethod (env, current_context_menu, 376 (*env)->CallNonvirtualVoidMethod (env, current_context_menu,
diff --git a/src/sfntfont.c b/src/sfntfont.c
index d556092db12..3506742a92b 100644
--- a/src/sfntfont.c
+++ b/src/sfntfont.c
@@ -545,6 +545,11 @@ sfnt_parse_style (Lisp_Object style_name, struct sfnt_font_desc *desc)
545 continue; 545 continue;
546 } 546 }
547 547
548 /* The adstyle must be a symbol, so intern it if it is set. */
549
550 if (!NILP (desc->adstyle))
551 desc->adstyle = Fintern (desc->adstyle, Qnil);
552
548 SAFE_FREE (); 553 SAFE_FREE ();
549} 554}
550 555
@@ -1655,7 +1660,7 @@ sfntfont_list_1 (struct sfnt_font_desc *desc, Lisp_Object spec,
1655 if (NILP (desc->instances)) 1660 if (NILP (desc->instances))
1656 { 1661 {
1657 tem = AREF (spec, FONT_ADSTYLE_INDEX); 1662 tem = AREF (spec, FONT_ADSTYLE_INDEX);
1658 if (!NILP (tem) && NILP (Fequal (tem, desc->adstyle))) 1663 if (!NILP (tem) && !EQ (tem, desc->adstyle))
1659 return 0; 1664 return 0;
1660 1665
1661 if (FONT_WIDTH_NUMERIC (spec) != -1 1666 if (FONT_WIDTH_NUMERIC (spec) != -1