From: Jose Dapena Paz Date: Mon, 21 Jul 2008 17:36:18 +0000 (+0000) Subject: * src/modest-ui-actions.c: X-Git-Tag: git_migration_finished~1260 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=3f21c213ccf17f4399d2dde0e2c8359ab20f1596;hp=f8f62f368b4cc8403b6e118510a786c6db098df9 * src/modest-ui-actions.c: * Disable copying (even from keyboard shortcut) of gtkhtml buffer if it's empty (fixes NB#86618). pmo-trunk-r5081 --- diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 82a7845..8bae8df 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -3796,9 +3796,16 @@ modest_ui_actions_on_copy (GtkAction *action, gtk_clipboard_set_can_store (clipboard, NULL, 0); gtk_clipboard_store (clipboard); } else if (GTK_IS_HTML (focused_widget)) { - gtk_html_copy (GTK_HTML (focused_widget)); - gtk_clipboard_set_can_store (clipboard, NULL, 0); - gtk_clipboard_store (clipboard); + const gchar *sel; + int len = -1; + sel = gtk_html_get_selection_html (GTK_HTML (focused_widget), &len); + if ((sel == NULL) || (sel[0] == '\0')) { + copied = FALSE; + } else { + gtk_html_copy (GTK_HTML (focused_widget)); + gtk_clipboard_set_can_store (clipboard, NULL, 0); + gtk_clipboard_store (clipboard); + } } else if (GTK_IS_TEXT_VIEW (focused_widget)) { GtkTextBuffer *buffer; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (focused_widget));