summaryrefslogtreecommitdiff
path: root/libview/ev-view-accessible.c
diff options
context:
space:
mode:
authorAlejandro PiƱeiro <[email protected]>2014-02-25 12:02:21 +0100
committerraveit65 <[email protected]>2017-11-27 10:13:51 +0100
commit137dab44c694cb52000708501e7118b30f2bfa1b (patch)
tree1fff0b4e10dade599baeb4ffc5bb5d969d574499 /libview/ev-view-accessible.c
parentb77806ce4d47b41edba14324f567540798c501e6 (diff)
downloadatril-137dab44c694cb52000708501e7118b30f2bfa1b.tar.bz2
atril-137dab44c694cb52000708501e7118b30f2bfa1b.tar.xz
a11y: fixing implementation for atk_text_set_caret_offset
It uses the recently added ev_view_set_caret_cursor_position https://bugzilla.gnome.org/show_bug.cgi?id=701746 https://git.gnome.org/browse/evince/commit/?h=gnome-3-12&id=912d9d5
Diffstat (limited to 'libview/ev-view-accessible.c')
-rw-r--r--libview/ev-view-accessible.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index 26a2554c..5f68973d 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -327,20 +327,17 @@ static gboolean
ev_view_accessible_set_caret_offset (AtkText *text, gint offset)
{
GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter pos_itr;
+ EvView *view;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
if (widget == NULL)
/* State is defunct */
return FALSE;
- buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget));
- if (!buffer)
- return FALSE;
-
- gtk_text_buffer_get_iter_at_offset (buffer, &pos_itr, offset);
- gtk_text_buffer_place_cursor (buffer, &pos_itr);
+ view = EV_VIEW (widget);
+ ev_view_set_caret_cursor_position (view,
+ view->cursor_page,
+ offset);
return TRUE;
}