X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-dimming-rules.c;h=7ab6ff0edcf0d6740a2effee1d6354a0f98d4e1e;hp=aaef4602555f151eedc9c80ae47d9fa1b5c4069d;hb=f4c8ac213f2217771e21aade64fbed16d618a77e;hpb=680a124cd675955c69b0aad1e14942cf32c9b159 diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index aaef460..7ab6ff0 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -2287,13 +2287,6 @@ _clipboard_is_empty (ModestWindow *win) } static gboolean -_forward_search_image_char (gunichar ch, - gpointer userdata) -{ - return (ch == 0xFFFC); -} - -static gboolean _invalid_clipboard_selected (ModestWindow *win, ModestDimmingRule *rule) { @@ -2310,23 +2303,8 @@ _invalid_clipboard_selected (ModestWindow *win, gboolean has_selection = FALSE; if (GTK_IS_TEXT_VIEW (focused)) { GtkTextBuffer *buffer = NULL; - GtkTextIter start, end; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (focused)); - has_selection = gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (buffer)); - - /* check there are no images in selection */ - if (has_selection) { - gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (buffer), &start, &end); - if (gtk_text_iter_get_char (&start)== 0xFFFC) - has_selection = FALSE; - else { - gtk_text_iter_backward_char (&end); - if (gtk_text_iter_forward_find_char (&start, _forward_search_image_char, - NULL, &end)) - has_selection = FALSE; - } - - } + has_selection = modest_text_utils_buffer_selection_is_valid (buffer); } else if (GTK_IS_EDITABLE (focused)) { has_selection = gtk_editable_get_selection_bounds (GTK_EDITABLE (focused), NULL, NULL); }