mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
composetable: Warn for things we can't handle
The compose table stores the keyvals to match against in a guint16 array, so it can't handle directly encoded Unicode codepoints (which have a high bit set). Warn if we encounter those.
This commit is contained in:
parent
a0d8678a9c
commit
dc2914e1f9
@ -231,7 +231,7 @@ parse_compose_sequence (const char *seq,
|
||||
char *start = words[i];
|
||||
char *end = strchr (words[i], '>');
|
||||
char *match;
|
||||
gunichar codepoint;
|
||||
guint keyval;
|
||||
|
||||
if (words[i][0] == '\0')
|
||||
continue;
|
||||
@ -248,18 +248,24 @@ parse_compose_sequence (const char *seq,
|
||||
|
||||
if (is_codepoint (match))
|
||||
{
|
||||
codepoint = (gunichar) g_ascii_strtoll (match + 1, NULL, 16);
|
||||
sequence[n] = codepoint;
|
||||
keyval = gdk_unicode_to_keyval ((gunichar) g_ascii_strtoll (match + 1, NULL, 16));
|
||||
if (keyval > 0xffff)
|
||||
g_warning ("Can't handle >16bit keyvals");
|
||||
|
||||
sequence[n] = (guint16) keyval;
|
||||
sequence[n + 1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
codepoint = (gunichar) gdk_keyval_from_name (match);
|
||||
sequence[n] = codepoint;
|
||||
keyval = gdk_keyval_from_name (match);
|
||||
if (keyval > 0xffff)
|
||||
g_warning ("Can't handle >16bit keyvals");
|
||||
|
||||
sequence[n] = (guint16) keyval;
|
||||
sequence[n + 1] = 0;
|
||||
}
|
||||
|
||||
if (codepoint == GDK_KEY_VoidSymbol)
|
||||
if (keyval == GDK_KEY_VoidSymbol)
|
||||
g_warning ("Could not get code point of keysym %s", match);
|
||||
g_free (match);
|
||||
n++;
|
||||
|
Loading…
Reference in New Issue
Block a user