X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=90248603e06b244f33293a429cb12678be702833;hp=cc8f566f928d3270172a6d163fc8602fa9d2d8b2;hb=f4c8ac213f2217771e21aade64fbed16d618a77e;hpb=680a124cd675955c69b0aad1e14942cf32c9b159 diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index cc8f566..9024860 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -3271,9 +3271,11 @@ modest_ui_actions_on_cut (GtkAction *action, GtkTextBuffer *buffer; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (focused_widget)); - gtk_text_buffer_cut_clipboard (buffer, clipboard, TRUE); - gtk_clipboard_set_can_store (clipboard, NULL, 0); - gtk_clipboard_store (clipboard); + if (modest_text_utils_buffer_selection_is_valid (buffer)) { + gtk_text_buffer_cut_clipboard (buffer, clipboard, TRUE); + gtk_clipboard_set_can_store (clipboard, NULL, 0); + gtk_clipboard_store (clipboard); + } } else if (MODEST_IS_HEADER_VIEW (focused_widget)) { TnyList *header_list = modest_header_view_get_selected_headers ( MODEST_HEADER_VIEW (focused_widget)); @@ -3330,9 +3332,11 @@ modest_ui_actions_on_copy (GtkAction *action, } else if (GTK_IS_TEXT_VIEW (focused_widget)) { GtkTextBuffer *buffer; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (focused_widget)); - gtk_text_buffer_copy_clipboard (buffer, clipboard); - gtk_clipboard_set_can_store (clipboard, NULL, 0); - gtk_clipboard_store (clipboard); + if (modest_text_utils_buffer_selection_is_valid (buffer)) { + gtk_text_buffer_copy_clipboard (buffer, clipboard); + gtk_clipboard_set_can_store (clipboard, NULL, 0); + gtk_clipboard_store (clipboard); + } } else if (MODEST_IS_HEADER_VIEW (focused_widget)) { TnyList *header_list = modest_header_view_get_selected_headers ( MODEST_HEADER_VIEW (focused_widget));