]> www.fi.muni.cz Git - evince.git/commitdiff
Fix critical warnings when there is no document loaded.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Thu, 15 Feb 2007 19:09:30 +0000 (19:09 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Thu, 15 Feb 2007 19:09:30 +0000 (19:09 +0000)
2007-02-15  Carlos Garcia Campos  <carlosgc@gnome.org>
* shell/ev-view.c: (ev_view_button_press_event),
(ev_view_key_press_event):
Fix critical warnings when there is no document loaded.

svn path=/trunk/; revision=2330

ChangeLog
shell/ev-view.c

index a611405217aca6373d87b1adbb2dd537532d7c58..e83ae34a03d4f68c985360b98db6fdc405cdb686 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-15  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-view.c: (ev_view_button_press_event),
+       (ev_view_key_press_event):
+
+       Fix critical warnings when there is no document loaded. 
+
 2007-02-15  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-page-action-widget.c:
index 0186a021ca4bf10f32b05e7932c654626ba56a1a..27a2149a2b63b16a65cb2b5f42abb622aa7ce29d 100644 (file)
@@ -1982,6 +1982,9 @@ ev_view_button_press_event (GtkWidget      *widget,
                            GdkEventButton *event)
 {
        EvView *view = EV_VIEW (widget);
+
+       if (!view->document)
+               return FALSE;
        
        if (!GTK_WIDGET_HAS_FOCUS (widget)) {
                gtk_widget_grab_focus (widget);
@@ -2584,6 +2587,9 @@ ev_view_key_press_event (GtkWidget   *widget,
        EvView *view = EV_VIEW (widget);
        EvPresentationState current;
 
+       if (!view->document)
+               return FALSE;
+       
        if (!view->presentation ||
            view->presentation_state == EV_PRESENTATION_END)
                return gtk_bindings_activate_event (GTK_OBJECT (widget), event);