diff options
author | Havoc Pennington <hp@redhat.com> | 2000-12-11 15:51:20 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-12-11 15:51:20 +0000 |
commit | 310a0d4fcca113f1dbc60feaba406f6b5526df43 (patch) | |
tree | de25976d3423470edd30ab727c6e09f9f774e968 /gtk/gtkimcontextsimple.c | |
parent | 116853db94f841c81565ecd8cd94302143e3dda8 (diff) | |
download | gdk-pixbuf-310a0d4fcca113f1dbc60feaba406f6b5526df43.tar.gz |
Handle chopping off \r\n and 0x2029 in addition to \n before passing to
2000-12-11 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_line_display):
Handle chopping off \r\n and 0x2029 in addition to \n before
passing to PangoLayout
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_get_preedit_string):
return an empty string if no match is pending
* gtk/gtkimcontext.c (gtk_im_context_get_preedit_string): add
assertion that the returned preedit string was sane
* gtk/gtktext*.[hc], gtk/testtext.c, gtk/testtextbuffer.c:
s/gtk_text_iter_next_char/gtk_text_iter_forward_char/g;
s/gtk_text_iter_prev_char/gtk_text_iter_backward_char/g;
Diffstat (limited to 'gtk/gtkimcontextsimple.c')
-rw-r--r-- | gtk/gtkimcontextsimple.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 4b346dc9c..36da2c96a 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -945,6 +945,7 @@ check_hex (GtkIMContextSimple *context_simple, GString *str; gulong n; gchar *nptr = NULL; + gchar buf[7]; str = g_string_new (NULL); @@ -952,7 +953,6 @@ check_hex (GtkIMContextSimple *context_simple, while (i < n_compose) { gunichar ch; - gchar buf[7]; ch = gdk_keyval_to_unicode (context_simple->compose_buffer[i]); @@ -1223,9 +1223,13 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context, len = g_unichar_to_utf8 (context_simple->tentative_match, outbuf); } - g_assert (len <= 25); + g_assert (len < 25); outbuf[len] = '\0'; } + else + { + outbuf[0] = '\0'; + } if (str) *str = g_strdup (outbuf); |