summaryrefslogtreecommitdiff
path: root/libview/ev-view-accessible.c
diff options
context:
space:
mode:
authorAlejandro PiƱeiro <[email protected]>2014-04-11 17:08:17 +0200
committerraveit65 <[email protected]>2017-11-27 10:13:51 +0100
commit806e8143f1f4e46a2e46c1ebe8dd337740505685 (patch)
tree159066f13b00d28ce40e1bfc58d7e408a990644e /libview/ev-view-accessible.c
parentce4c2292416969901af2c55735905fae5b7ed594 (diff)
downloadatril-806e8143f1f4e46a2e46c1ebe8dd337740505685.tar.bz2
atril-806e8143f1f4e46a2e46c1ebe8dd337740505685.tar.xz
a11y: ensure text cached when you request an EvPageAccessible
https://bugzilla.gnome.org/show_bug.cgi?id=724965 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=b5fc924
Diffstat (limited to 'libview/ev-view-accessible.c')
-rw-r--r--libview/ev-view-accessible.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index ae55ddd4..2932c5e1 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -138,11 +138,21 @@ ev_view_accessible_ref_child (AtkObject *obj,
gint i)
{
EvViewAccessible *self;
+ EvView *view;
g_return_val_if_fail (EV_IS_VIEW_ACCESSIBLE (obj), NULL);
self = EV_VIEW_ACCESSIBLE (obj);
g_return_val_if_fail (i >= 0 || i < ev_view_accessible_get_n_pages (self), NULL);
+ view = EV_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)));
+ if (view == NULL)
+ return NULL;
+
+ /* If a given page is requested, we assume that the text would
+ * be requested soon, so we need to be sure that is cached.*/
+ if (view->page_cache)
+ ev_page_cache_ensure_page (view->page_cache, i);
+
return g_object_ref (g_ptr_array_index (self->priv->children, i));
}