From 3f21c213ccf17f4399d2dde0e2c8359ab20f1596 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 21 Jul 2008 17:36:18 +0000 Subject: [PATCH 1/1] * src/modest-ui-actions.c: * Disable copying (even from keyboard shortcut) of gtkhtml buffer if it's empty (fixes NB#86618). pmo-trunk-r5081 --- src/modest-ui-actions.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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)); -- 1.7.9.5