[evince/gnome-3-8] libview: Fix warning on ev_view_document_changed_cb
- From: Germán Poó Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/gnome-3-8] libview: Fix warning on ev_view_document_changed_cb
- Date: Sat, 8 Jun 2013 14:40:15 +0000 (UTC)
commit 543159547d6bbc57a6258b312dda5017bff20094
Author: Germán Poo-Caamaño <gpoo gnome org>
Date: Fri Jun 7 12:59:15 2013 -0700
libview: Fix warning on ev_view_document_changed_cb
There was an introduction of a warning when fixing the bug
https://bugzilla.gnome.org/show_bug.cgi?id=701302
If ev_view_document_changed_cb () is emitted when there
is no previous document, the check fails.
This patch change the order of the condition checks.
libview/ev-view.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 7bd7f28..6bda520 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -5321,10 +5321,6 @@ ev_view_document_changed_cb (EvDocumentModel *model,
{
EvDocument *document = ev_document_model_get_document (model);
- if (ev_document_get_n_pages (document) <= 0 ||
- !ev_document_check_dimensions (document))
- return;
-
if (document != view->document) {
gint current_page;
@@ -5335,12 +5331,15 @@ ev_view_document_changed_cb (EvDocumentModel *model,
g_object_unref (view->document);
}
- view->document = document;
+ view->document = document ? g_object_ref (document) : NULL;
view->find_result = 0;
if (view->document) {
+ if (ev_document_get_n_pages (view->document) <= 0 ||
+ !ev_document_check_dimensions (view->document))
+ return;
+
ev_view_set_loading (view, FALSE);
- g_object_ref (view->document);
setup_caches (view);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]