diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2005-04-14 15:41:30 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-04-14 15:41:30 (GMT) |
commit | 1561766454d8a06d887da5c2955b8c4d1dddd9a3 (patch) | |
tree | 85e839740013b1cd263cb2c151ab82d90de42d13 /shell/ev-view.c | |
parent | cfce03c7e1db82c1abad3ba4b39652986589e2a3 (diff) |
Fix the crash when trying to copy in backends that doesnt support it. We
2005-04-14 Marco Pesenti Gritti <mpg@redhat.com>
* backend/ev-document.h:
* djvu/djvu-document.c: (djvu_document_can_get_text),
(djvu_document_document_iface_init):
* dvi/dvi-document.c: (dvi_document_can_get_text),
(dvi_document_document_iface_init):
* pdf/ev-poppler.cc:
* pixbuf/pixbuf-document.c: (pixbuf_document_can_get_text),
(pixbuf_document_document_iface_init):
* ps/ps-document.c: (ps_document_can_get_text),
(ps_document_document_iface_init):
* shell/ev-view.c: (ev_view_copy), (ev_view_primary_get_cb):
* shell/ev-window.c: (update_action_sensitivity):
Fix the crash when trying to copy in backends that doesnt
support it. We can implement a better solution once we
do real text selection.
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r-- | shell/ev-view.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index 5678fc2..b615b6c 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -620,6 +620,10 @@ ev_view_copy (EvView *ev_view) GtkClipboard *clipboard; char *text; + if (!ev_document_can_get_text (ev_view->document)) { + return; + } + g_mutex_lock (EV_DOC_MUTEX); text = ev_document_get_text (ev_view->document, ev_view->current_page, @@ -641,6 +645,10 @@ ev_view_primary_get_cb (GtkClipboard *clipboard, EvView *ev_view = EV_VIEW (data); char *text; + if (!ev_document_can_get_text (ev_view->document)) { + return; + } + g_mutex_lock (EV_DOC_MUTEX); text = ev_document_get_text (ev_view->document, ev_view->current_page, |