Skip to content
Browse files

Check legal boundaries of accessible pages

Fixes #302

Keep the accessible view end page under the limits of the document.
Sometimes when a document is reloaded, it may have less pages making
the end page higher than the actual number of pages.

Fix end_page reset after reload a page

When a document is reloaded, and the accessible end_page is higher
than the number of pages, it must be re-initialized to the number
of pages minus one because it refers to elements in an array.


origin commits:
  • Loading branch information...
gpoo authored and raveit65 committed Feb 19, 2016
1 parent 291facd commit e79d2665e8a4c80d7650e96906545579cb1bf930
Showing with 7 additions and 0 deletions.
  1. +7 −0 libview/ev-view-accessible.c
@@ -380,6 +380,13 @@ initialize_children (EvViewAccessible *self)
child = ev_page_accessible_new (self, i);
g_ptr_array_add (self->priv->children, child);
/* When a document is reloaded, it may have less pages.
* We need to update the end page accordingly to avoid
* invalid access to self->priv->children
* See
if (self->priv->end_page >= n_pages)
self->priv->end_page = n_pages - 1;

static void

0 comments on commit e79d266

Please sign in to comment.
You can’t perform that action at this time.