[evince/gnome-3-10] ev-view-accessible: call document_changed_cb when setting the model



commit 3d06f42bcc78b4cf2ff4f903d46798effdff8773
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Oct 3 12:13:18 2013 -0400

    ev-view-accessible: call document_changed_cb when setting the model
    
    When an application embedding an EvView reuses that view to display a new
    document, the content of last page viewed from the previous document is
    exposed to assistive technologies. In order to get the content of the
    current document, the user must change pages. This problem resulted from
    the assumption that the document would be set after the model was set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709375

 libview/ev-view-accessible.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index f8009f5..5d1fe89 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -1113,6 +1113,11 @@ document_changed_cb (EvDocumentModel  *model,
                     GParamSpec       *pspec,
                     EvViewAccessible *accessible)
 {
+       EvDocument *document = ev_document_model_get_document (model);
+
+       if (document == NULL)
+               return;
+
        clear_cache (accessible);
 }
 
@@ -1132,6 +1137,7 @@ ev_view_accessible_set_model (EvViewAccessible *accessible,
 
        priv->model = g_object_ref (model);
 
+       document_changed_cb (model, NULL, accessible);
        g_signal_connect (priv->model, "page-changed",
                          G_CALLBACK (page_changed_cb),
                          accessible);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]