diff options
author | Joanmarie Diggs <[email protected]> | 2014-03-14 05:00:37 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-11-27 10:13:51 +0100 |
commit | 10e2bd8e5a729f4472f4260704f605ae1f30d89f (patch) | |
tree | 7a4af7771f751f8d1897ebe477698878bce990fe | |
parent | a8550dae6aa72a2d7dc6cc83a71317d4c1f09929 (diff) | |
download | atril-10e2bd8e5a729f4472f4260704f605ae1f30d89f.tar.bz2 atril-10e2bd8e5a729f4472f4260704f605ae1f30d89f.tar.xz |
libview: Take caret navigation into account when getting AtkHyperlink indices
https://bugzilla.gnome.org/show_bug.cgi?id=726310
https://git.gnome.org/browse/evince/commit/?h=gnome-3-12&id=5e4d9f8
-rw-r--r-- | libview/ev-link-accessible.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libview/ev-link-accessible.c b/libview/ev-link-accessible.c index beac1c0a..c6ae096c 100644 --- a/libview/ev-link-accessible.c +++ b/libview/ev-link-accessible.c @@ -90,6 +90,12 @@ ev_hyperlink_get_object (AtkHyperlink *atk_hyperlink, } static gint +get_relevant_page (EvView *view) +{ + return ev_view_is_caret_navigation_enabled (view) ? view->cursor_page : view->current_page; +} + +static gint ev_hyperlink_get_start_index (AtkHyperlink *atk_hyperlink) { EvHyperlink *hyperlink = EV_HYPERLINK (atk_hyperlink); @@ -113,7 +119,7 @@ ev_hyperlink_get_start_index (AtkHyperlink *atk_hyperlink) if (!view->page_cache) return -1; - ev_page_cache_get_text_layout (view->page_cache, view->current_page, &areas, &n_areas); + ev_page_cache_get_text_layout (view->page_cache, get_relevant_page (view), &areas, &n_areas); if (!areas) return -1; @@ -155,7 +161,7 @@ ev_hyperlink_get_end_index (AtkHyperlink *atk_hyperlink) if (!view->page_cache) return -1; - ev_page_cache_get_text_layout (view->page_cache, view->current_page, &areas, &n_areas); + ev_page_cache_get_text_layout (view->page_cache, get_relevant_page (view), &areas, &n_areas); if (!areas) return -1; |