diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2005-09-27 12:18:38 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-09-27 12:18:38 (GMT) |
commit | 19033026f00585b3710644250f851ca02246c9fc (patch) | |
tree | f93bcf49c70e8e8b05214b4b4001b2c6bc43c01a | |
parent | 9ab501f7ddc9df9a2904f88602146261d6f7dcae (diff) |
Check tooltip is valid utf8 before showing it
2005-09-27 Marco Pesenti Gritti <mpg@redhat.com>
* shell/ev-view.c: (handle_link_over_xy):
Check tooltip is valid utf8 before showing it
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | shell/ev-view.c | 10 |
2 files changed, 13 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2005-09-27 Marco Pesenti Gritti <mpg@redhat.com> + + * shell/ev-view.c: (handle_link_over_xy): + + Check tooltip is valid utf8 before showing it + 2005-09-27 Carlos Garcia Campos <carlosgc@gnome.org> * shell/ev-view.c: Allow drag and drop of text. Fixes #316772 diff --git a/shell/ev-view.c b/shell/ev-view.c index 7f77726..fe84912 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -1363,9 +1363,13 @@ handle_link_over_xy (EvView *view, gint x, gint y) if (link) { char *msg = tip_from_link (view, link); - ev_tooltip_set_position (EV_TOOLTIP (view->link_tooltip), x, y); - ev_tooltip_set_text (EV_TOOLTIP (view->link_tooltip), msg); - ev_tooltip_activate (EV_TOOLTIP (view->link_tooltip)); + if (msg && g_utf8_validate (msg, -1, NULL)) { + EvTooltip *tooltip = EV_TOOLTIP (view->link_tooltip); + + ev_tooltip_set_position (tooltip, x, y); + ev_tooltip_set_text (tooltip, msg); + ev_tooltip_activate (tooltip); + } g_free (msg); ev_view_set_cursor (view, EV_VIEW_CURSOR_LINK); |