[evince] a11y: cleaning implementation for atk_text_get_caret_offset



commit 3b63aa8370e4280a5f5b4e7ec8e8bae964b3709f
Author: Alejandro Piñeiro <apinheiro igalia com>
Date:   Tue Feb 25 12:18:38 2014 +0100

    a11y: cleaning implementation for atk_text_get_caret_offset
    
    If caret access is not enabled (or in any other error) caret_offset
    should be -1, and not one based on the gtktextbuffer.
    
    Based on a previous patch by Joanmarie Diggs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701746

 libview/ev-view-accessible.c |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index 81bc618..8645f37 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -297,30 +297,17 @@ ev_view_accessible_get_caret_offset (AtkText *text)
 {
        GtkWidget *widget;
        EvView *view;
-       GtkTextBuffer *buffer;
-       GtkTextMark *cursor_mark;
-       GtkTextIter cursor_itr;
-       gint retval;
 
        widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
        if (widget == NULL)
                /* State is defunct */
-               return 0;
+               return -1;
 
        view = EV_VIEW (widget);
-
        if (view->caret_enabled)
                return view->cursor_offset;
 
-       buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget));
-       if (!buffer)
-               return 0;
-
-       cursor_mark = gtk_text_buffer_get_insert (buffer);
-       gtk_text_buffer_get_iter_at_mark (buffer, &cursor_itr, cursor_mark);
-       retval = gtk_text_iter_get_offset (&cursor_itr);
-
-       return retval;
+       return -1;
 }
 
 static gboolean


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